:root {
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;

  --emerald-400: #34d399;
  --emerald-500: #10b981;

  --amber-400: #fbbf24;
  --amber-500: #f59e0b;

  --purple-400: #c084fc;
  --purple-500: #a855f7;

  --rose-400: #fb7185;
  --rose-500: #f43f5e;
  --rose-600: #e11d48;

  --blue-600: #2563eb;
  --white: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }

.hidden { display: none !important; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.shrink-0 { flex-shrink: 0; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.space-x-1\.5 > * + * { margin-left: 0.375rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.inset-y-0 { top: 0; bottom: 0; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.top-\[-10\%\] { top: -10%; }
.left-\[-10\%\] { left: -10%; }
.bottom-\[-10\%\] { bottom: -10%; }
.right-\[-10\%\] { right: -10%; }
.-right-4 { right: -1rem; }
.-bottom-4 { bottom: -1rem; }

.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-50 { z-index: 50; }

.w-full { width: 100%; }
.w-3\.5 { width: 0.875rem; }
.w-4 { width: 1rem; }
.w-4\.5 { width: 1.125rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-9 { width: 2.25rem; }
.w-10 { width: 2.5rem; }
.w-24 { width: 6rem; }
.w-36 { width: 9rem; }
.w-64 { width: 16rem; }
.w-\[600px\] { width: 600px; }
.min-w-0 { min-width: 0; }

.h-3\.5 { height: 0.875rem; }
.h-4 { height: 1rem; }
.h-4\.5 { height: 1.125rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-16 { height: 4rem; }
.h-24 { height: 6rem; }
.h-screen { height: 100vh; }
.h-\[600px\] { height: 600px; }
.h-\[280px\] { height: 280px; }

.min-h-screen { min-height: 100vh; }
.max-h-\[90vh\] { max-height: 90vh; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-3\.5 { padding: 0.875rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-3\.5 { padding-left: 0.875rem; padding-right: 0.875rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.pt-4 { padding-top: 1rem; }
.pb-4 { padding-bottom: 1rem; }
.pl-3 { padding-left: 0.75rem; }
.pl-10 { padding-left: 2.5rem; }
.pr-4 { padding-right: 1rem; }

.m-0 { margin: 0; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-auto { margin-top: auto; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-64 { margin-left: 16rem; }

.text-\[11px\] { font-size: 11px; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.tracking-tight { letter-spacing: -0.025em; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }

.uppercase { text-transform: uppercase; }
.text-center { text-align: center; }
.text-left { text-align: left; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }

.border { border-width: 1px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-r { border-right-width: 1px; border-right-style: solid; }

.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

.bg-slate-800 { background-color: var(--slate-800); }
.bg-slate-900 { background-color: var(--slate-900); }
.bg-slate-950 { background-color: var(--slate-950); }
.bg-indigo-600 { background-color: var(--indigo-600); }
.bg-rose-600 { background-color: var(--rose-600); }

.bg-slate-900\/40 { background-color: rgba(15, 23, 42, 0.4); }
.bg-slate-900\/50 { background-color: rgba(15, 23, 42, 0.5); }
.bg-slate-900\/60 { background-color: rgba(15, 23, 42, 0.6); }
.bg-slate-950\/20 { background-color: rgba(2, 6, 23, 0.2); }
.bg-slate-950\/30 { background-color: rgba(2, 6, 23, 0.3); }
.bg-slate-950\/40 { background-color: rgba(2, 6, 23, 0.4); }
.bg-slate-950\/70 { background-color: rgba(2, 6, 23, 0.7); }
.bg-slate-950\/80 { background-color: rgba(2, 6, 23, 0.8); }

.bg-indigo-500\/5 { background-color: rgba(99, 102, 241, 0.05); }
.bg-indigo-500\/10 { background-color: rgba(99, 102, 241, 0.1); }
.bg-indigo-500\/20 { background-color: rgba(99, 102, 241, 0.2); }
.bg-emerald-500\/5 { background-color: rgba(16, 185, 129, 0.05); }
.bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.1); }
.bg-amber-500\/5 { background-color: rgba(245, 158, 11, 0.05); }
.bg-amber-500\/10 { background-color: rgba(245, 158, 11, 0.1); }
.bg-purple-500\/5 { background-color: rgba(168, 85, 247, 0.05); }
.bg-purple-500\/10 { background-color: rgba(168, 85, 247, 0.1); }
.bg-rose-500\/10 { background-color: rgba(244, 63, 94, 0.1); }

.bg-gradient-to-tr { background-image: linear-gradient(to top right, var(--tw-from, transparent), var(--tw-to, transparent)); }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-from, transparent), var(--tw-to, transparent)); }

.from-indigo-500\/10 { --tw-from: rgba(99, 102, 241, 0.1); }
.to-indigo-500\/20 { --tw-to: rgba(99, 102, 241, 0.2); }
.from-white { --tw-from: #ffffff; }
.via-slate-100 { --tw-via: var(--slate-100); }
.to-slate-400 { --tw-to: var(--slate-400); }
.from-indigo-600 { --tw-from: var(--indigo-600); }
.to-blue-600 { --tw-to: var(--blue-600); }

.from-white.via-slate-100.to-slate-400 {
  background-image: linear-gradient(to right, #ffffff, var(--slate-100), var(--slate-400));
}

.bg-clip-text { -webkit-background-clip: text; background-clip: text; }
.text-transparent { color: transparent; }

.text-white { color: var(--white); }
.text-slate-100 { color: var(--slate-100); }
.text-slate-200 { color: var(--slate-200); }
.text-slate-300 { color: var(--slate-300); }
.text-slate-400 { color: var(--slate-400); }
.text-slate-500 { color: var(--slate-500); }
.text-indigo-400 { color: var(--indigo-400); }
.text-emerald-400 { color: var(--emerald-400); }
.text-rose-400 { color: var(--rose-400); }

.border-slate-700 { border-color: var(--slate-700); }
.border-slate-800 { border-color: var(--slate-800); }
.border-slate-900 { border-color: var(--slate-900); }
.border-slate-905 { border-color: var(--slate-900); }
.border-rose-500 { border-color: var(--rose-500); }

.border-slate-800\/70 { border-color: rgba(30, 41, 59, 0.7); }
.border-slate-800\/80 { border-color: rgba(30, 41, 59, 0.8); }
.border-slate-900\/60 { border-color: rgba(15, 23, 42, 0.6); }
.border-slate-900\/70 { border-color: rgba(15, 23, 42, 0.7); }
.border-slate-900\/80 { border-color: rgba(15, 23, 42, 0.8); }
.border-indigo-500\/20 { border-color: rgba(99, 102, 241, 0.2); }
.border-rose-500\/20 { border-color: rgba(244, 63, 94, 0.2); }

.placeholder-slate-500::placeholder { color: var(--slate-500); }
.placeholder-slate-600::placeholder { color: var(--slate-600); }

.ring-2 { box-shadow: 0 0 0 2px var(--tw-ring-color, rgba(99, 102, 241, 0.5)); }
.ring-indigo-500\/20 { --tw-ring-color: rgba(99, 102, 241, 0.2); }

.shadow-inner { box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.3); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); }

.blur-xl { filter: blur(24px); }
.blur-\[150px\] { filter: blur(150px); }
.backdrop-blur { backdrop-filter: blur(8px); }
.backdrop-blur-sm { backdrop-filter: blur(4px); }
.backdrop-blur-md { backdrop-filter: blur(12px); }

.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fade-in 0.3s ease-out; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

.pointer-events-none { pointer-events: none; }

.hover\:bg-slate-800:hover { background-color: var(--slate-800); }
.hover\:bg-slate-700:hover { background-color: var(--slate-700); }
.hover\:bg-slate-800\/40:hover { background-color: rgba(30, 41, 59, 0.4); }
.hover\:bg-rose-500:hover { background-color: var(--rose-500); }
.hover\:bg-indigo-700:hover { background-color: var(--indigo-700); }
.hover\:text-white:hover { color: var(--white); }

.focus\:outline-none:focus { outline: none; }
.focus\:border-indigo-500:focus { border-color: var(--indigo-500); }
.focus\:ring-4:focus { box-shadow: 0 0 0 4px var(--tw-ring-color, rgba(99, 102, 241, 0.1)); }
.focus\:ring-indigo-500\/10:focus { --tw-ring-color: rgba(99, 102, 241, 0.1); }

.disabled\:opacity-50:disabled { opacity: 0.5; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }

.group:hover .group-hover\:bg-indigo-500\/10 { background-color: rgba(99, 102, 241, 0.1); }
.group:hover .group-hover\:bg-amber-500\/10 { background-color: rgba(245, 158, 11, 0.1); }
.group:hover .group-hover\:bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.1); }
.group:hover .group-hover\:bg-purple-500\/10 { background-color: rgba(168, 85, 247, 0.1); }

@media (min-width: 640px) {
  .sm\:flex-row { flex-direction: row; }
}

@media (min-width: 768px) {
  .md\:p-10 { padding: 2.5rem; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:flex-row { flex-direction: row; }
  .md\:items-center { align-items: center; }
  .md\:justify-between { justify-content: space-between; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ============================================================
   FIXES — utility classes referenced in index.html but missing
   from the original stylesheet (caused unclipped rounded
   corners, broken table/modal scrolling, and invisible amber
   & purple icon colors on the dashboard stat cards).
   ============================================================ */
.overflow-hidden { overflow: hidden; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-hidden { overflow-y: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-auto { overflow: auto; }

.text-amber-400 { color: var(--amber-400); }
.text-purple-400 { color: var(--purple-400); }

.border-amber-500\/20 { border-color: rgba(245, 158, 11, 0.2); }
.border-emerald-500\/20 { border-color: rgba(16, 185, 129, 0.2); }
.border-purple-500\/20 { border-color: rgba(168, 85, 247, 0.2); }

/* Accessible keyboard focus (previously suppressed everywhere by
   focus:outline-none with no visible-focus fallback for elements
   like buttons and links that don't carry a focus:ring class). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--indigo-400);
  outline-offset: 2px;
}

/* Thin, on-brand scrollbar for the new overflow-y-auto modal
   bodies (form panels) so long forms don't show a bare OS bar. */
.overflow-y-auto::-webkit-scrollbar { width: 6px; }
.overflow-y-auto::-webkit-scrollbar-track { background: transparent; }
.overflow-y-auto::-webkit-scrollbar-thumb { background: var(--slate-700); border-radius: 9999px; }

/* Responsive sidebar: below 900px the fixed 16rem sidebar plus
   ml-64 main content had no fallback and would overflow/clip on
   tablets and phones. Auto-collapse to the icon rail that the
   existing .collapsed styles already define, no JS required. */
@media (max-width: 900px) {
  #sidebar { width: 80px !important; }
  #sidebar .nav-label,
  #sidebar .user-info-text,
  #sidebar .logout-text { display: none !important; }
  #sidebarHeader { padding-left: 0.5rem !important; padding-right: 0.5rem !important; justify-content: center !important; }
  #sidebar .sidebar-link { justify-content: center !important; padding-left: 0 !important; padding-right: 0 !important; margin-left: 0.35rem !important; margin-right: 0.35rem !important; }
  #sidebar .sidebar-link i { margin-right: 0 !important; }
  #sidebar .sidebar-profile-box { justify-content: center !important; padding-left: 0.25rem !important; padding-right: 0.25rem !important; }
  #sidebar .logout-btn-elem { padding-left: 0 !important; padding-right: 0 !important; width: 2.5rem !important; height: 2.5rem !important; justify-content: center !important; }
  #mainContentArea { margin-left: 80px !important; }
  #sidebarCollapseBtn { display: none; }
}

@media (max-width: 560px) {
  .p-8 { padding: 1.25rem !important; }
  .px-8 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
  .grid-cols-3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}

/* More missing utility classes for layout, sidebar, grid & modals */
.w-20 { width: 5rem; }
.ml-20 { margin-left: 5rem; }
.col-span-full { grid-column: 1 / -1; }
.max-w-6xl { max-width: 72rem; }
.z-\[80\] { z-index: 80; }
.z-\[90\] { z-index: 90; }
.text-slate-350 { color: #cbd5e1; }

@media (min-width: 1280px) {
  .xl\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Item-row: base table row style used by JS builders */
.item-row {
  transition: background 0.15s ease;
  border-left: 2px solid transparent;
}
.item-row:hover {
  background: rgba(99, 102, 241, 0.04);
  border-left-color: #6366f1;
}
.item-row td { border-bottom: 1px solid rgba(255,255,255,0.03); vertical-align: middle; }

/* --- Missing utility patches --- */
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.mt-auto { margin-top: auto; }
.mb-2 { margin-bottom: 0.5rem; }
.pl-3 { padding-left: 0.75rem; }
.select-all { user-select: all; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }
.whitespace-nowrap { white-space: nowrap; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-auto { overflow: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.leading-relaxed { line-height: 1.625; }
.min-w-0 { min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.block { display: block; }
.inline-block { display: inline-block; }