:root {
  --bg-color: #0b0f19;
  --bg-color-rgb: 11, 15, 25;
  --text-color: #f1f5f9;
  --text-secondary: #94a3b8;
  --card-bg: rgba(17, 24, 39, 0.6);
  --card-border: rgba(255, 255, 255, 0.05);
  --slate-900: #0f172a;
  --slate-950: #0b0f19;
  --border-color: #1e293b;
  --kanban-col-bg: rgba(15, 23, 42, 0.3);
  --chart-bar-bg: rgba(30, 41, 59, 0.8);
}

:root.light {
  --bg-color: #f8fafc;
  --bg-color-rgb: 248, 250, 252;
  --text-color: #0f172a;
  --text-secondary: #475569;
  --card-bg: rgba(255, 255, 255, 0.8);
  --card-border: rgba(15, 23, 42, 0.08);
  --slate-900: #f1f5f9;
  --slate-950: #ffffff;
  --border-color: #cbd5e1;
  --kanban-col-bg: rgba(241, 245, 249, 0.5);
  --chart-bar-bg: rgba(203, 213, 225, 0.8);
}

/* Reset & Fonts */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* Color Tokens & Gradients */
.gradient-text {
  background: linear-gradient(135deg, #14b8a6 0%, #f9a8d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Glassmorphism card */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}
.glass-card:hover {
  border-color: var(--card-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
}

/* Layout Utilities (Tailwind mapping for EJS compatibility) */
.max-w-md { max-width: 28rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-7xl { max-width: 80rem; }
.w-full { width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.grid { display: grid; }
.items-center { align-items: center; }
.justify-center { justify-content: content; align-items: center; justify-content: center; }
.justify-between { justify-content: space-between; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.space-y-12 > * + * { margin-top: 3rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.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)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 640px) {
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Spacings */
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-12 { padding-bottom: 3rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-4 { margin-bottom: 1rem; }

/* Font size & weight */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-tight { letter-spacing: -0.025em; }
.text-center { text-align: center; }
.text-left { text-align: left; }

/* Colors */
.text-white { color: var(--text-color) !important; }
.text-slate-100 { color: var(--text-color) !important; }
.text-slate-200 { color: var(--text-color) !important; }
.text-slate-300 { color: var(--text-color) !important; }
.text-slate-400 { color: var(--text-secondary) !important; }
.text-slate-500 { color: var(--text-secondary) !important; }
.text-teal-400 { color: #2dd4bf; }
.text-teal-300 { color: #5eead4; }
.text-teal-500 { color: #14b8a6; }
.text-rose-300 { color: #fda4af; }
.text-rose-400 { color: #fb7185; }
.text-purple-400 { color: #c084fc; }
.text-amber-500 { color: #f59e0b; }
.text-blue-400 { color: #60a5fa; }
.text-emerald-400 { color: #34d399; }

.bg-slate-900 { background-color: var(--slate-900) !important; }
.bg-slate-900\/40 { background-color: var(--card-bg) !important; }
.bg-slate-900\/50 { background-color: var(--card-bg) !important; }
.bg-slate-950 { background-color: var(--bg-color) !important; }
.bg-slate-950\/80 { background-color: rgba(var(--bg-color-rgb), 0.8) !important; }
.bg-teal-500\/10 { background-color: rgba(20, 184, 166, 0.1); }
.bg-teal-500\/20 { background-color: rgba(20, 184, 166, 0.2); }
.bg-teal-950\/20 { background-color: rgba(13, 148, 136, 0.2); }
.bg-rose-500\/10 { background-color: rgba(244, 63, 94, 0.1); }
.bg-rose-500\/20 { background-color: rgba(244, 63, 94, 0.2); }
.bg-amber-500\/10 { background-color: rgba(245, 158, 11, 0.1); }
.bg-blue-500\/10 { background-color: rgba(59, 130, 246, 0.1); }
.bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.1); }
.bg-purple-500\/10 { background-color: rgba(139, 92, 246, 0.1); }
.bg-slate-800 { background-color: var(--slate-900) !important; }

/* Borders & Rounding */
.border { border: 1px solid var(--border-color) !important; }
.border-b { border-bottom: 1px solid var(--border-color) !important; }
.border-slate-700\/50 { border-color: var(--border-color) !important; }
.border-slate-800 { border-color: var(--border-color) !important; }
.border-slate-900 { border-color: var(--border-color) !important; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-full { border-radius: 9999px; }

/* Headers & Sticky */
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-50 { z-index: 50; }
.backdrop-blur-md { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* Buttons & Inputs */
input, select {
  font-family: inherit;
  background-color: var(--slate-900) !important;
  color: var(--text-color) !important;
  border-color: var(--border-color) !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus {
  border-color: #14b8a6 !important;
  box-shadow: 0 0 0 1px #14b8a6 !important;
}

/* Autofill override */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text-color) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--slate-900) inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

button {
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.2s ease-in-out;
}

/* Custom interactive classes */
.size-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.size-card.selected {
  border-color: #14b8a6;
  background: rgba(20, 184, 166, 0.1);
  box-shadow: 0 0 16px rgba(20, 184, 166, 0.15);
}

.flavor-item-card {
  transition: all 0.2s ease;
}
.flavor-item-card.selected {
  border-color: #f9a8d4;
  background: rgba(249, 168, 212, 0.08);
}
.flavor-item-card.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #14b8a6;
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* Kanban Cards and Columns */
.bg-slate-900\/30 {
  background-color: var(--kanban-col-bg) !important;
}
.kanban-col {
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}
.kanban-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px;
  transition: all 0.2s ease;
}
.kanban-card:hover {
  transform: translateY(-2px);
  border-color: var(--card-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Charts / Bars */
.chart-bar-bg {
  background-color: var(--chart-bar-bg);
  height: 8px;
  border-radius: 4px;
  width: 100%;
}
.chart-bar-fill {
  background: linear-gradient(90deg, #14b8a6 0%, #f9a8d4 100%);
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease-in-out;
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.hover\:scale-105:hover { transform: scale(1.05); }
.active\:scale-95:active { transform: scale(0.95); }
.hidden { display: none !important; }

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--slate-900);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}
.theme-toggle:hover {
  transform: scale(1.05);
  background-color: var(--card-bg);
}
.theme-toggle:active {
  transform: scale(0.95);
}

/* Responsive & Kanban Board Enhancements */
.overflow-x-auto {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.w-1\/4 {
  width: 25%;
}

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

.min-h-\[300px\] {
  min-height: 300px;
}

@media (max-width: 1023px) {
  .kanban-container {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    gap: 1rem !important;
    padding-bottom: 1rem;
    grid-template-columns: none !important; /* overrides grid column styling */
  }
  
  .kanban-col {
    flex: 0 0 280px !important;
    scroll-snap-align: start;
  }
}

@media (max-width: 640px) {
  .header-content {
    flex-direction: column !important;
    gap: 0.75rem !important;
    text-align: center !important;
  }
  
  .header-content .flex {
    justify-content: center !important;
  }
  
  /* Make lists and panels look cleaner on very small screens */
  .glass-card {
    padding: 1.25rem !important;
  }
}

/* Display & Layout Utilities */
.block { display: block !important; }
.h-2 { height: 0.5rem !important; }
.h-full { height: 100% !important; }
.gap-1 { gap: 0.25rem !important; }
.border-t { border-top: 1px solid var(--border-color) !important; }
.border-slate-700 { border-color: var(--border-color) !important; }
.bg-gradient-to-r {
  background: linear-gradient(90deg, #14b8a6 0%, #f9a8d4 100%) !important;
}

/* Header Buttons Adjustments */
.header-content button {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 90px;
}

/* Light-mode color enhancements for status text */
:root.light .text-blue-400 { color: #1d4ed8 !important; }
:root.light .text-emerald-400 { color: #047857 !important; }
:root.light .text-purple-400 { color: #6d28d9 !important; }
:root.light .text-amber-500 { color: #b45309 !important; }

