/* Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Links never look like browser-default hyperlinks: buttons/rows own their style */
a, a:visited, a:hover, a:active {
    color: inherit;
    text-decoration: none;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* Container */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container {
        max-width: 640px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

/* Flex utilities */
.flex {
    display: flex;
}

/* Inline flex */
.inline-flex { display: inline-flex; }

/* Justify content */
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* Align items */
.items-center { align-items: center; }

/* Align self */
.self-center { align-self: center; }

/* Flex direction */
.flex-col { flex-direction: column; }

/* Flex grow/shrink/basis */
.flex-1 { flex: 1 1 0%; }
.flex-grow { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* Gap utilities */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }

/* Margin utilities */
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-6 { margin-left: 1.5rem; }
.pl-3 { padding-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }
.ml-64 { margin-left: 16rem; }
.ml-20 { margin-left: 5rem; }
.-mt-16 { margin-top: -4rem; }

/* Padding utilities */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.pb-6 { padding-bottom: 1.5rem; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.pr-8 { padding-right: 2rem; }
.pl-6 { padding-left: 1.5rem; }
.pl-8 { padding-left: 2rem; }

/* Width utilities */
.w-8 { width: 2rem; }
.w-9 { width: 2.25rem; }
.w-12 { width: 3rem; }
.w-14 { width: 3.5rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-32 { width: 8rem; }
.w-5 { width: 1.25rem; }
.w-full { width: 100%; }

/* Height utilities */
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-12 { height: 3rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.h-20 { height: 5rem; }
.h-32 { height: 8rem; }
.h-5 { height: 1.25rem; }
.h-screen { height: 100vh; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Max width utilities */
.max-w-md { max-width: 28rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }

/* Positioning */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }

/* Z-index */
.z-10 { z-index: 10; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* Display */
.block { display: block; }
.inline { display: inline; }
.hidden { display: none; }

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leading-relaxed { line-height: 1.625; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.uppercase { text-transform: uppercase; }
.no-underline { text-decoration: none; }

/* Focus ring utilities */
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.5); }
.focus\:border-indigo-500:focus { border-color: #6366f1; }
.focus\:ring-offset-2:focus { --tw-ring-offset-width: 2px; }
.focus\:ring-indigo-500:focus { --tw-ring-color: rgba(99, 102, 241, 0.5); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.5); }
.focus\:outline-none:focus { outline: none; }

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

.flex-wrap {
    flex-wrap: wrap;
}

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

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

.justify-center {
    justify-content: center;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Spacing */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

/* Width and Height */
.w-9 { width: 2.25rem; }
.h-9 { height: 2.25rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.w-16 { width: 4rem; }
.h-16 { height: 4rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }

/* Colors */
.bg-white { background-color: #ffffff; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-indigo-50 { background-color: #e0e7ff; }
.bg-indigo-100 { background-color: #c7d2fe; }
.bg-indigo-500 { background-color: #6366f1; }
.bg-indigo-600 { background-color: #4f46e5; }
.bg-purple-600 { background-color: #7c3aed; }
.bg-green-100 { background-color: #bbf7d0; }
.bg-red-100 { background-color: #fee2e2; }
.bg-violet-100 { background-color: #ddd6fe; }
.bg-amber-100 { background-color: #fef3c7; }
.bg-white\/20 { background-color: rgba(255, 255, 255, 0.2); }
.bg-black\/20 { background-color: rgba(0, 0, 0, 0.2); }

/* Text colors */
.text-white { color: #ffffff; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1e293b; }
.text-slate-900 { color: #0f172a; }
.text-indigo-600 { color: #4f46e5; }
.text-red-600 { color: #dc2626; }
.text-green-600 { color: #16a34a; }
.text-red-700 { color: #b91c1c; }
.text-green-700 { color: #15803d; }
.text-indigo-700 { color: #4338ca; }
.text-violet-700 { color: #6b21a8; }
.text-amber-700 { color: #b45309; }
.text-white\/80 { color: rgba(255, 255, 255, 0.8); }
.text-white\/70 { color: rgba(255, 255, 255, 0.7); }

/* Gradients - individual utility classes that work together */
.bg-gradient-to-br {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
    --tw-gradient-from: #4f46e5;
    --tw-gradient-via: #9333ea;
    --tw-gradient-to: #ec4899;
    --tw-gradient-from-position: 0%;
    --tw-gradient-via-position: 50%;
    --tw-gradient-to-position: 100%;
}
.bg-gradient-to-t {
    background-image: linear-gradient(to top, var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
    --tw-gradient-from: #4f46e5;
    --tw-gradient-to: #9333ea;
    --tw-gradient-from-position: 0%;
    --tw-gradient-to-position: 100%;
}

/* Gradient color stops - from-* */
.from-indigo-600 { --tw-gradient-from: #4f46e5; }
.from-indigo-500 { --tw-gradient-from: #6366f1; }
.from-indigo-400 { --tw-gradient-from: #818cf8; }
.from-purple-600 { --tw-gradient-from: #9333ea; }
.from-emerald-400 { --tw-gradient-from: #34d399; }
.from-rose-400 { --tw-gradient-from: #fb7185; }
.from-white\/10 { --tw-gradient-from: rgba(255, 255, 255, 0.1); }
.from-slate-50 { --tw-gradient-from: #f8fafc; }
.from-white\/20 { --tw-gradient-from: rgba(255, 255, 255, 0.2); }

/* Gradient color stops - via-* */
.via-purple-600 { --tw-gradient-via: #9333ea; }
.via-indigo-500 { --tw-gradient-via: #6366f1; }

/* Gradient color stops - to-* */
.to-pink-500 { --tw-gradient-to: #ec4899; }
.to-purple-600 { --tw-gradient-to: #7c3aed; }
.to-purple-500 { --tw-gradient-to: #a855f7; }
.to-emerald-600 { --tw-gradient-to: #059669; }
.to-rose-600 { --tw-gradient-to: #e11d48; }
.to-transparent { --tw-gradient-to: transparent; }
.to-slate-100 { --tw-gradient-to: #f1f5f9; }

/* Opacity utility classes - bg-white/N */
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.1); }
.bg-white\/20 { background-color: rgba(255, 255, 255, 0.2); }
.bg-white\/30 { background-color: rgba(255, 255, 255, 0.3); }
.bg-white\/80 { background-color: rgba(255, 255, 255, 0.8); }
.bg-black\/20 { background-color: rgba(0, 0, 0, 0.2); }
.bg-black\/50 { background-color: rgba(0, 0, 0, 0.5); }
/* Opacity utility classes - bg-slate/N */
.bg-slate-900\/70 { background-color: rgba(15, 23, 42, 0.7); }
.bg-slate-800\/80 { background-color: rgba(30, 41, 59, 0.8); }
/* Opacity utility classes - text-white/N */
.text-white\/70 { color: rgba(255, 255, 255, 0.7); }
.text-white\/80 { color: rgba(255, 255, 255, 0.8); }
.text-white\/90 { color: rgba(255, 255, 255, 0.9); }
/* Opacity utility classes - border-white/N */
.border-white\/20 { border-color: rgba(255, 255, 255, 0.2); }
/* Opacity utility classes - from-white/N */
.from-white\/10 { --tw-gradient-from: rgba(255, 255, 255, 0.1); }

/* bg-opacity fallback */
.bg-opacity-50 { background-color: rgba(0, 0, 0, 0.5); }

/* Borders */
.border { border-width: 1px; border-style: solid; }
.border-slate-100 { border-color: #e2e8f0; }
.border-gray-200 { border-color: #e5e7eb; }
.border-red-200 { border-color: #fecaca; }
.border-white\/20 { border-color: rgba(255, 255, 255, 0.2); }

/* Border radius */
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* Shadows */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }
.shadow-soft {
    box-shadow: 0 2px 15px -3px rgba(0, 0, 0, 0.07), 0 10px 20px -2px rgba(0, 0, 0, 0.04);
}

/* Font sizes */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }

/* Font weights */
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* Transitions */
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* Hover states */
.hover:bg-indigo-50:hover { background-color: #e0e7ff; }
.hover:bg-indigo-100:hover { background-color: #c7d2fe; }
.hover:bg-slate-50:hover { background-color: #f8fafc; }
.hover:bg-red-50:hover { background-color: #fee2e2; }
.hover:text-indigo-600:hover { color: #4f46e5; }
.hover:text-indigo-800:hover { color: #3730a3; }
.hover:text-red-600:hover { color: #dc2626; }
.hover:bg-indigo-700:hover { background-color: #4338ca; }
.hover:bg-indigo-600:hover { background-color: #4f46e5; }

/* Grid */
.grid { display: grid; }
.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: 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)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@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)); }
}

.lg\:col-span-2 { grid-column: span 2 / span 2; }

/* Other utilities */
.min-h-screen { min-height: 100vh; }
.flex-grow { flex-grow: 1; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.top-16 { top: 4rem; }
.bottom-0 { bottom: 0; }
.min-w-0 { min-width: 0; }
.w-11 { width: 2.75rem; }
.h-11 { height: 2.75rem; }
.z-50 { z-index: 50; }
.z-40 { z-index: 40; }
.z-30 { z-index: 30; }
.backdrop-blur-lg { backdrop-filter: blur(12px); }
.backdrop-blur-sm { backdrop-filter: blur(4px); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Off-canvas sidebar drawer (mobile <768px): the fixed aside is slid off the
   left edge by -100% and pulled back in with .translate-x-0 when opened. */
.left-0 { left: 0; }
.-translate-x-full { transform: translateX(-100%); }
.translate-x-0 { transform: translateX(0); }
.bg-black\/40 { background-color: rgba(0, 0, 0, 0.4); }

/* Button base styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Navbar */
.navbar-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #475569;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.navbar-link:hover {
    background-color: #e0e7ff;
    color: #4f46e5;
}

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

.animate-spin {
    animation: spin 1s linear infinite;
}

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

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

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

.animate-slide-up {
    animation: slideUp 0.3s ease-out;
}

/* Space utilities */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }

/* Responsive utilities */
@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .md\:inline { display: inline; }
    .md\:inline-flex { display: inline-flex; }
}

@media (min-width: 768px) {
    .md\:hidden { display: none; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:text-2xl { font-size: 1.5rem; }
    .md\:text-5xl { font-size: 3rem; }
    .md\:text-6xl { font-size: 3.75rem; }
}

@media (min-width: 1024px) {
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .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)); }
    .lg\:inline { display: inline; }
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* Negative margin */
.-translate-y-1-2 { transform: translateY(-50%); }
.translate-x-1-2 { transform: translateX(50%); }

/* Hidden */
.hidden { display: none; }

/* Additional Color Classes */
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-emerald-100 { background-color: #d1fae5; }
.bg-emerald-400 { background-color: #34d399; }
.bg-emerald-500 { background-color: #10b981; }
.bg-emerald-600 { background-color: #059669; }
.bg-rose-50 { background-color: #fff1f2; }
.bg-rose-100 { background-color: #ffe4e6; }
.bg-rose-400 { background-color: #f43f5e; }
.bg-rose-500 { background-color: #f43f5e; }
.bg-rose-600 { background-color: #e11d48; }
.bg-violet-50 { background-color: #f5f3ff; }
.bg-violet-100 { background-color: #ede9fe; }
.bg-violet-400 { background-color: #a78bfa; }
.bg-violet-500 { background-color: #8b5cf6; }
.bg-violet-600 { background-color: #7c3aed; }
.bg-amber-50 { background-color: #fffbeb; }
.bg-amber-100 { background-color: #fef3c7; }
.bg-amber-400 { background-color: #fbbf24; }
.bg-amber-500 { background-color: #f59e0b; }

.text-emerald-600 { color: #059669; }
.text-rose-600 { color: #e11d48; }
.text-violet-600 { color: #7c3aed; }
.text-amber-600 { color: #d97706; }
.text-amber-700 { color: #b45309; }
.text-emerald-700 { color: #047857; }

/* Additional Border Radius */
.rounded-2xl { border-radius: 1rem; }

/* Border width */
.border-8 { border-width: 8px; }
.border-b-2 { border-bottom-width: 2px; }
.border-0 { border-width: 0; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-transparent { border-color: transparent; }

/* Box shadow */
.shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

/* Opacity */
.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }
.opacity-75 { opacity: 0.75; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-pointer { cursor: pointer; }

/* Transform */
.transform { transform: translateZ(0); }
.scale-100 { transform: scale(1); }

/* Border opacity */
.border-white\/20 { border-color: rgba(255, 255, 255, 0.2); }
.border-amber-200 { border-color: #fde68a; }

/* Shadows with opacity */
.shadow-indigo-500-25 { box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.25), 0 2px 4px -2px rgba(79, 70, 229, 0.25); }
.shadow-emerald-500-25 { box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.25), 0 2px 4px -2px rgba(16, 185, 129, 0.25); }
.shadow-rose-500-25 { box-shadow: 0 4px 6px -1px rgba(244, 63, 94, 0.25), 0 2px 4px -2px rgba(244, 63, 94, 0.25); }
.shadow-violet-500-25 { box-shadow: 0 4px 6px -1px rgba(139, 92, 246, 0.25), 0 2px 4px -2px rgba(139, 92, 246, 0.25); }

/* Shadow sizes */
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

/* Drop shadows */
.drop-shadow-sm { filter: drop-shadow(0 1px 1px rgba(0,0,0,0.05)); }
.drop-shadow-md { filter: drop-shadow(0 4px 3px rgba(0,0,0,0.07)); }
.drop-shadow-lg { filter: drop-shadow(0 10px 8px rgba(0,0,0,0.07)); }

/* Backdrop filter */
.backdrop-blur-sm { backdrop-filter: blur(4px); }
.backdrop-blur-lg { backdrop-filter: blur(12px); }

/* Transform utilities */
.transform { transform: translateZ(0); }
.hover--translate-y-1:hover { transform: translateY(-0.25rem); }
.group-hover\:scale-110 { transform: scale(1.1); }

/* Transition utilities */
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* Translate utilities */
.-translate-y-1-2 { transform: translateY(-0.5rem); }
.translate-x-1-2 { transform: translateX(0.5rem); }

/* Group hover */
.group:hover .group-hover\:scale-110 { transform: scale(1.1); }
.group:hover .group-hover\:text-slate-900 { color: #0f172a; }
.group:hover .group-hover\:text-white { color: #ffffff; }
.group:hover .group-hover\:opacity-100 { opacity: 1; }
.group:hover .group-hover\:opacity-0 { opacity: 0; }

/* Hover translate */
.hover--translate-y-1:hover { transform: translateY(-0.25rem); }

/* Group hover scale */
.group-hover-scale-110 { transform: scale(1); transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1); }
.group:hover .group-hover-scale-110 { transform: scale(1.1); }

/* Group hover text color */
.group-hover-text-slate-900 { color: #0f172a; transition: color 200ms cubic-bezier(0.4, 0, 0.2, 1); }
.group:hover .group-hover-text-slate-900 { color: #0f172a; }

/* Translate utilities for decorative elements */
.-translate-y-1-2 { transform: translateY(-0.5rem); }
.translate-x-1-2 { transform: translateX(0.5rem); }

/* More shadow utilities */
.shadow-indigo-500-25 { box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.25), 0 2px 4px -2px rgba(79, 70, 229, 0.25); }
.shadow-emerald-500-25 { box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.25), 0 2px 4px -2px rgba(16, 185, 129, 0.25); }
.shadow-rose-500-25 { box-shadow: 0 4px 6px -1px rgba(244, 63, 94, 0.25), 0 2px 4px -2px rgba(244, 63, 94, 0.25); }
.shadow-violet-500-25 { box-shadow: 0 4px 6px -1px rgba(139, 92, 246, 0.25), 0 2px 4px -2px rgba(139, 92, 246, 0.25); }
.shadow-slate-500-25 { box-shadow: 0 4px 6px -1px rgba(100, 116, 139, 0.25), 0 2px 4px -2px rgba(100, 116, 139, 0.25); }

/* Gap utilities */
.gap-12 { gap: 3rem; }

/* Text sizes */
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }

/* Margin utilities */
.mb-12 { margin-bottom: 3rem; }

/* Padding utilities */
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }

/* Sidebar specific classes */
.h-screen { height: 100vh; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.w-64 { width: 16rem; }
.w-20 { width: 5rem; }

/* Sidebar content styling */
.border-slate-700 { border-color: #334155; }
.bg-slate-900 { background-color: #0f172a; }
.text-slate-200 { color: #cbd5e1; }
.text-slate-300 { color: #94a3b8; }
.text-slate-400 { color: #94a3b8; }

/* Active link styling */
.bg-indigo-600 { background-color: #4f46e5; }

/* Main content margin to account for sidebar */
.ml-64 { margin-left: 16rem; }
.ml-20 { margin-left: 5rem; }

/* Flex utilities */
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

/* Overflow */
.overflow-y-auto { overflow-y: auto; }

/* Calc height */
.h-[calc(100vh-4rem)] { height: calc(100vh - 4rem); }

/* Text utilities */
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }

/* Border utilities */
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }

/* Color utilities */
.text-white { color: #ffffff; }

/* DaisyUI-like Component Classes */

/* Base colors (daisyUI theme) */
.bg-base-100 { background-color: #ffffff; }
.bg-base-200 { background-color: #f1f5f9; }
.bg-base-300 { background-color: #e2e8f0; }
.text-base-content { color: #0f172a; }

/* Buttons */
.btn-primary {
    background-color: #7B2D3B;
    color: #ffffff;
    border: 1px solid #7B2D3B;
}
.btn-primary:hover {
    background-color: #5A1E2A;
    color: #ffffff;
}
.btn-outline {
    background-color: transparent;
    color: #7B2D3B;
    border: 1px solid #7B2D3B;
}
.btn-outline:hover {
    background-color: #5A1E2A;
    color: #ffffff;
}
.btn-error {
    background-color: #dc2626;
    color: #ffffff;
    border: 1px solid #dc2626;
}
.btn-error:hover {
    background-color: #b91c1c;
    color: #ffffff;
}
.btn-success {
    background-color: #16a34a;
    color: #ffffff;
    border: 1px solid #16a34a;
}
.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.5rem;
}
.btn {
    border-radius: 0.625rem;
    min-height: 44px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-weight: 600;
}
.btn-lg {
    min-height: 52px;
    font-size: 1rem;
    font-weight: 700;
}

/* Alerts */
.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}
.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}
.alert {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

/* Inputs */
.input-bordered,
.textarea-bordered,
.select-bordered {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: #0f172a;
    background-color: #ffffff;
}
.input-bordered:focus,
.textarea-bordered:focus,
.select-bordered:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* Mobile touch targets: corner rounding + a taller hit area for form controls
   on small screens (Settings separators, currency, language, date format...). */
@media (max-width: 767px) {
    .input-bordered,
    .textarea-bordered,
    .select-bordered {
        min-height: 2.75rem;
        padding-top: 0.625rem;
        padding-bottom: 0.625rem;
    }
}

/* Date picker: a text input + calendar button in one bordered group so the
   icon sits neatly in front of (beside) the date box and matches card borders. */
.date-group {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}
.date-group .date-text {
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 0.5rem 0 0 0.5rem;
    border-right: none;
}
.date-group .date-text:focus {
    border-right: none;
    box-shadow: none;
}
.date-pick {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0 0.5rem;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-left: none;
    border-radius: 0 0.5rem 0.5rem 0;
    color: #64748b;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}
.date-pick:hover {
    background-color: #f1f5f9;
}
.date-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
/* Custom in-app month-grid calendar popover (Holocene-aware). Anchored below
   the date input; the parent .date-group is position: relative. */
.date-popover {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    z-index: 40;
    width: 288px;
    padding: 0.75rem;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}
.date-popover-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.date-popover-title {
    flex: 1 1 auto;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: #0f172a;
    white-space: nowrap;
}
.date-popover-nav,
.date-popover-close {
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: #f1f5f9;
    color: #334155;
    border-radius: 0.375rem;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.date-popover-nav:hover,
.date-popover-close:hover {
    background-color: #e2e8f0;
}
.date-popover-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.15rem;
}
.date-popover-dow {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    padding: 0.25rem 0;
}
.date-popover-day {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: none;
    background-color: transparent;
    color: #0f172a;
    font-size: 0.85rem;
    border-radius: 0.4rem;
    cursor: pointer;
    padding: 0;
    text-align: center; /* override the global button{text-align:left} */
}
/* Open the popover upward when there isn't room below the field. */
.date-popover.date-popover-up {
    top: auto;
    bottom: calc(100% + 0.35rem);
}

/* Custom themed time picker (TimeField) — themed popover of 5-minute options. */
.time-group {
    position: relative;
}
.time-pick {
    position: absolute;
    top: 50%;
    right: 0.6rem;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1rem;
    z-index: 2;
}
.time-popover {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 40;
    width: 148px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}
.time-now {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #7b2d3b;
    background-color: #f9eef0;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
    cursor: pointer;
}
.time-popover-list {
    max-height: 220px;
    overflow-y: auto;
}
.time-opt {
    display: block;
    width: 100%;
    padding: 0.45rem 0;
    font-size: 0.85rem;
    color: #0f172a;
    background: transparent;
    border: none;
    text-align: center;
    cursor: pointer;
    border-radius: 0.25rem;
}
.time-opt:hover {
    background-color: #f1f5f9;
}
.time-opt-sel {
    background-color: #7b2d3b;
    color: #ffffff;
    font-weight: 600;
}
html[data-theme="dark"] .time-now { background-color: #3a1a20; color: #d98a96; border-bottom-color: #334155; }
html[data-theme="dark"] .time-popover { background-color: #1e293b; border-color: #475569; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
html[data-theme="dark"] .time-opt { color: #cbd5e1; }
html[data-theme="dark"] .time-opt:hover { background-color: #334155; }
html[data-theme="dark"] .time-opt-sel { background-color: #7b2d3b; color: #ffffff; }

/* Notes: markdown-rendered title/body previews (docs_md output is safe HTML). */
.note-render { font-size: 0.9rem; line-height: 1.5; color: #475569; }
.note-render > :first-child { margin-top: 0; }
.note-render > :last-child { margin-bottom: 0; }
.note-render p { margin: 0 0 0.5rem; }
.note-render h1, .note-render h2, .note-render h3, .note-render h4,
.note-render h5, .note-render h6 { margin: 0.5rem 0 0.25rem; font-size: 1.1em; font-weight: 700; }
.note-render pre { background: #f1f5f9; padding: 0.5rem 0.75rem; border-radius: 0.5rem; overflow-x: auto; margin: 0.5rem 0; }
.note-render code { background: #f1f5f9; padding: 0 0.25rem; border-radius: 0.25rem; }
.note-render pre code { background: transparent; padding: 0; }
.note-render ul, .note-render ol { margin: 0.5rem 0 0.5rem 1.25rem; padding: 0; }
.note-render li { margin: 0.15rem 0; }
.note-render blockquote { border-left: 3px solid #cbd5e1; margin: 0.5rem 0; padding-left: 0.75rem; color: #64748b; }
.note-render-title { line-height: 1.3; }
.note-render-body { max-height: 12rem; overflow: hidden; }
.note-render-clamp { max-height: 4.5rem; overflow: hidden; }
html[data-theme="dark"] .note-render { color: #cbd5e1; }
html[data-theme="dark"] .note-render pre { background: #0f172a; }
html[data-theme="dark"] .note-render code { background: #0f172a; color: #e2e8f0; }
html[data-theme="dark"] .note-render blockquote { border-left-color: #475569; color: #94a3b8; }
.date-popover-day:hover {
    background-color: #f1f5f9;
}
.date-popover-day-today {
    box-shadow: inset 0 0 0 1.5px #1b3a5c;
}
.date-popover-day-sel {
    background-color: #7b2d3b;
    color: #ffffff;
    font-weight: 600;
}
.date-popover-day-sel:hover {
    background-color: #7b2d3b;
}

.textarea-bordered {
    padding: 0.75rem;
    min-height: 100px;
    resize: vertical;
}
.select-bordered {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org\/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Badges */
.badge-outline {
    border: 1px solid #d1d5db;
    color: #475569;
    border-radius: 9999px;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
}
.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-radius: 9999px;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
}
.badge-success {
    background-color: #dcfce7;
    color: #166534;
    border-radius: 9999px;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
}
.badge-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-radius: 9999px;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
}
.badge {
    border-radius: 9999px;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
}

/* Cards */
.card {
    border-radius: 0.75rem;
    border: 1px solid #cbd5e1;
    overflow: hidden;
}
.card-title {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Tables */
.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #334155;
    border-bottom: 2px solid #e2e8f0;
}
.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

/* ============================================================
   Missing utilities audit — everything used in markup below
   ============================================================ */

/* Gray palette (used by navbar, pages, placeholders) */
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-900 { color: #111827; }
.border-gray-300 { border-color: #d1d5db; }
.bg-gray-50 { background-color: #f9fafb; }

/* Indigo extras */
.text-indigo-100 { color: #e0e7ff; }
.text-indigo-300 { color: #a5b4fc; }
.border-indigo-200 { border-color: #c7d2fe; }
.border-t-indigo-600 { border-top-color: #4f46e5; }

/* Slate extras */
.border-slate-200 { border-color: #e2e8f0; }
.bg-slate-800 { background-color: #1e293b; }
.hover\:bg-slate-700:hover { background-color: #334155; }
.hover\:text-white:hover { color: #ffffff; }
.hover\:bg-slate-800\/80:hover { background-color: rgba(30, 41, 59, 0.8); }

/* Base-200 hover (table rows) */
.hover\:bg-base-200:hover { background-color: #f1f5f9; }

/* White/black */
.bg-black { background-color: #000000; }
.border-white { border-color: #ffffff; }
.hover\:bg-white\/30:hover { background-color: rgba(255, 255, 255, 0.3); }

/* Colored hovers for action tiles + alert button */
.hover\:bg-emerald-100:hover { background-color: #d1fae5; }
.hover\:bg-violet-100:hover { background-color: #ede9fe; }
.hover\:bg-rose-100:hover { background-color: #ffe4e6; }
.hover\:bg-amber-100:hover { background-color: #fef3c7; }

/* Error text (404 page) */
.text-error { color: #dc2626; }
.text-8xl { font-size: 6rem; }

/* Layout */
.fixed { position: fixed; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mx-4 { margin-left: 1rem; margin-right: 1rem; }
.mt-auto { margin-top: auto; }
.max-w-6xl { max-width: 72rem; }
.overflow-x-auto { overflow-x: auto; }
.items-start { align-items: flex-start; }
.justify-start { justify-content: flex-start; }
.top-0 { top: 0; }
.right-0 { right: 0; }

/* Spacing additions */
.p-3 { padding: 0.75rem; }
.p-5 { padding: 1.25rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-10 { padding-left: 2.5rem; padding-right: 2.5rem; }
.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\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.mr-2 { margin-right: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* Sizing additions */
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-16 { width: 4rem; }
.w-24 { width: 6rem; }
.w-48 { width: 12rem; }

/* Borders & radius additions */
.rounded-3xl { border-radius: 1.5rem; }
.border-l { border-left-width: 1px; border-left-style: solid; }
.border-4 { border-width: 4px; }

/* Shadows */
.shadow { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.hover\:shadow-lg:hover { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }

/* Escaped transform/translate utilities */
.hover\:-translate-y-1:hover { transform: translateY(-0.25rem); }
.-translate-y-1\/2 { transform: translateY(-50%); }
.translate-x-1\/2 { transform: translateX(50%); }

/* Duration */
.duration-300 { transition-duration: 300ms; }

/* Form element base classes (paired with *--bordered) */
.input, .textarea, .select {
    font-family: inherit;
    font-size: 0.875rem;
    color: #0f172a;
    background-color: #ffffff;
}
.checkbox {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #cbd5e1;
    border-radius: 0.375rem;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s ease;
    background-color: #ffffff;
}
.checkbox:checked {
    background-color: #7B2D3B;
    border-color: #7B2D3B;
}
.checkbox:checked::after {
    content: "";
    position: absolute;
    left: 0.3rem;
    top: 0.05rem;
    width: 0.35rem;
    height: 0.65rem;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
}
.label-text {
    font-size: 0.875rem;
    color: #334155;
}

/* Table base */
.table {
    border-collapse: collapse;
    width: 100%;
}

/* Buttons must not look like browser-default buttons */
button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

/* Calendar month grid */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.375rem; }
.cal-weekday { text-align: center; font-size: 0.75rem; font-weight: 600; color: #64748b; padding: 0.5rem 0; text-transform: uppercase; letter-spacing: 0.05em; }
.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    transition: all 0.15s ease;
}
.cal-day:hover { background: #f9eef0; border-color: #9E4A57; }
.cal-day-out { color: #94a3b8; background: #f8fafc; }
.cal-day-today { border-color: #7B2D3B; border-width: 2px; font-weight: 700; }
.cal-day-selected, .cal-day-selected:hover { background: #7B2D3B; color: #ffffff; border-color: #7B2D3B; }
.cal-dot { width: 0.375rem; height: 0.375rem; border-radius: 9999px; background: #7B2D3B; margin-top: 0.125rem; }
.cal-dot-task { width: 0.375rem; height: 0.375rem; border-radius: 9999px; background: #C5A55A; margin-top: 0.125rem; }
.cal-day-selected .cal-dot { background: #ffffff; }

/* Envelope progress bars */
.progress {
    width: 100%;
    height: 0.5rem;
    background-color: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Arbitrary min-width used by the budgets list progress row */
.min-w-\[150px\] { min-width: 9.375rem; }
.min-w-\[200px\] { min-width: 12.5rem; }

/* Avatar images */
.object-cover { object-fit: cover; }

/* Darker sub-sidebar */
.bg-slate-950 { background-color: #020617; }

/* ============================================================
   Brand palette — docs/company/brand-guidelines.md
   Bordeaux (primary) / Old Gold (accent, sparingly) / Deep Sapphire
   ============================================================ */
.bg-bordeaux { background-color: #7B2D3B; }
.bg-bordeaux-dark { background-color: #5A1E2A; }
.bg-bordeaux-light { background-color: #9E4A57; }
.bg-bordeaux-50 { background-color: #f9eef0; }
.bg-bordeaux-100 { background-color: #f2dde1; }
.hover\:bg-bordeaux-dark:hover { background-color: #5A1E2A; }
.hover\:bg-bordeaux-50:hover { background-color: #f9eef0; }
.hover\:bg-bordeaux-100:hover { background-color: #f2dde1; }
.text-bordeaux { color: #7B2D3B; }
.border-bordeaux { border-color: #7B2D3B; }
.focus\:border-bordeaux:focus { border-color: #7B2D3B; }
.focus\:ring-bordeaux:focus { box-shadow: 0 0 0 3px rgba(123, 45, 59, 0.35); }

.bg-gold { background-color: #C5A55A; }
.bg-gold-dark { background-color: #A88B3E; }
.bg-gold-light { background-color: #D4BB7A; }
.hover\:bg-gold-dark:hover { background-color: #A88B3E; }
.text-gold { color: #C5A55A; }
.text-gold-dark { color: #A88B3E; }

.bg-sapphire { background-color: #1B3A5C; }
.bg-sapphire-dark { background-color: #0F2540; }
.bg-sapphire-deepest { background-color: #0A1B30; }
.bg-sapphire-light { background-color: #2B5078; }
.bg-sapphire-50 { background-color: #e8eef7; }
.bg-sapphire-100 { background-color: #d4e0f0; }
.hover\:bg-sapphire-100:hover { background-color: #d4e0f0; }
.hover\:bg-sapphire-light:hover { background-color: #2B5078; }
.text-sapphire { color: #1B3A5C; }
.text-sapphire-dark { color: #0F2540; }
.border-sapphire-light { border-color: #2B5078; }

/* Deep forest green — income/positive accent, distinct from bordeaux (expense).
   Kept in the same deep, muted family as the rest of the palette. */
.bg-forest { background-color: #356E3B; }
.bg-forest-dark { background-color: #2A5630; }
.bg-forest-light { background-color: #4F8A55; }
.hover\:bg-forest-dark:hover { background-color: #2A5630; }
.text-forest { color: #356E3B; }
.border-forest { border-color: #356E3B; }

.text-slate-100 { color: #f1f5f9; }
.text-slate-200 { color: #e2e8f0; }
.bg-emerald-500 { background-color: #10b981; }
.bg-amber-500 { background-color: #f59e0b; }
.bg-rose-500 { background-color: #f43f5e; }

/* Misc additions */
.line-through { text-decoration: line-through; }
.ml-auto { margin-left: auto; }
.max-h-screen { max-height: 100vh; }
.badge-warning { background-color: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* Button group */
.btn-group {
    display: inline-flex;
    border-radius: 0.5rem;
    overflow: hidden;
}
.btn-group .btn {
    border-radius: 0;
}
.btn-group .btn:first-child {
    border-radius: 0.5rem 0 0 0.5rem;
}
.btn-group .btn:last-child {
    border-radius: 0 0.5rem 0.5rem 0;
}

/* Budget list view */
.budget-list-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

/* Finances sub-sidebar: subcategory links must ALWAYS be light on the dark
   sapphire background, at rest and on hover. High-specificity rule so no
   anchor/hover rule or utility can render them dark (Bug-Report => QA-Gap). */
aside.bg-sapphire-deepest a,
aside.bg-sapphire-deepest a:link,
aside.bg-sapphire-deepest a:visited,
aside.bg-sapphire-deepest a:hover,
aside.bg-sapphire-deepest a:active,
aside.bg-sapphire-deepest a span,
aside.bg-sapphire-deepest a svg {
    color: #ffffff;
    stroke: currentColor;
}

/* --------------------------------------------------------------------------
 * Landing page enhancements
 * ------------------------------------------------------------------------ */

/* Auth pages (login/register) and the landing hero fill the viewport below
   the sticky top bar (h-16 = 4rem), so they never overflow into an
   unnecessary scroll; the page only scrolls when real content is hidden. */
.vh-minus-nav { min-height: calc(100vh - 4rem); }

/* Auth screens: fill the space below the sticky top bar and center the card.
   Uses `safe center` alignment so the card centers when it fits and falls
   back to top-aligned + scrolls when the card is taller than the viewport
   (avoids the clipped/overlapping fields seen with flex-start + margin auto). */
.auth-screen {
    min-height: calc(100vh - 4rem);
    display: flex;
    align-items: safe center;
    justify-content: center;
    overflow-y: auto;
    padding: 3rem 1rem;
    background-color: var(--sapphire, #0f2547);
}
.auth-card-wrap { margin: 0; }

/* Scrolled-into-view sections anchor below the sticky top bar. */
#hero, #features { scroll-margin-top: 4rem; }

/* Landing scroll-down hint (animated chevron). */
.scroll-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    z-index: 10;
    padding: 0;
}
.scroll-hint-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.7);
}
.scroll-hint-chevron {
    font-size: 26px;
    line-height: 1;
    color: #C5A55A;
    animation: hintBounce 1.8s ease-in-out infinite;
}
@keyframes hintBounce {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50%      { transform: translateY(8px); opacity: 1; }
}

/* Landing side index: plain lines that reveal their label on hover / active. */
.spy-rail {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
    z-index: 40;
}
.spy-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
}
.spy-line {
    width: 22px;
    height: 2px;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    transition: width 0.2s ease, background-color 0.2s ease;
}
.spy-label {
    font-size: 12px;
    color: #ffffff;
    opacity: 0;
    transform: translateX(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
    pointer-events: none;
}
.spy-item:hover .spy-line,
.spy-active .spy-line {
    width: 34px;
    background-color: #C5A55A;
}
.spy-item:hover .spy-label,
.spy-active .spy-label {
    opacity: 1;
    transform: translateX(0);
}

/* Section navigation: squircle segmented control in the top bar. Used for both
   the Finances sub-pages and Settings (user/server) groups. A sliding "thumb"
   indicates the active slot and animates between selections; the whole control
   is draggable so users can drag or swipe to change the current sub-page. */
.section-nav {
    position: relative;
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    align-items: stretch;
    background: rgba(148, 163, 184, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    padding: 4px;
    overflow: hidden;
    touch-action: none;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}
.section-nav-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    bottom: 4px;
    background-color: #7B2D3B;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
    pointer-events: none;
    z-index: 0;
}
.section-tab {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
    transition: color 0.15s ease;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.section-tab:hover { color: #7B2D3B; }
.section-tab-active,
.section-tab-active:hover {
    color: #ffffff;
    font-weight: 600;
}

/* Segmented control: a non-navigating squircle selector (same visual family as
   .section-nav) used for choices like light/dark, personal/organization and
   income/expense. The sliding thumb colours can be overridden per use with
   e.g. `.bg-forest` (income) or `.bg-bordeaux` (expense). */
.seg {
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
    background: rgba(148, 163, 184, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    padding: 4px;
    overflow: hidden;
    touch-action: none;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}
.seg-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    bottom: 4px;
    background-color: #7B2D3B;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
    pointer-events: none;
    z-index: 0;
}
.seg-opt {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
    transition: color 0.15s ease;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.seg-opt:hover { color: #7B2D3B; }
.seg-opt-active,
.seg-opt-active:hover {
    color: #ffffff;
    font-weight: 600;
}

@media (max-width: 767px) {
    .seg-opt {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* Fixed-size "repeat every" unit buttons (day/days, week/weeks, ...). A fixed
   min-width keeps the row from jumping/squashing as the label changes between
   singular and plural, with generous padding for a comfortable hit target. */
.unit-btn {
    min-width: 7rem;
    padding: 0.75rem 1rem;
    text-align: center;
    white-space: nowrap;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

/* Mobile: the segmented pill gets less horizontal room once the sidebar is an
   off-canvas drawer (content is full-width but still narrow next to the
   hamburger + avatar/bell). Tabs switch to natural-width (`max-content`) with
   horizontal scrolling, the sliding thumb is replaced by a solid active pill,
   and labels render fully instead of clipping — A2 regression. */
@media (max-width: 767px) {
    .section-tab {
        padding: 6px 10px;
        font-size: 13px;
    }
    .section-nav {
        grid-auto-columns: max-content;
        overflow-x: auto;
        width: 100%;
        min-width: 0;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .section-nav::-webkit-scrollbar { display: none; }
    .section-nav-thumb { display: none; }
    .section-tab-active,
    .section-tab-active:hover {
        background-color: #7B2D3B;
        color: #ffffff;
    }
}

/* Dark-mode toggle switch (replaces the old <select>; Settings > Appearance).
   A `button[role=switch]` with a sliding knob: the knob is a child span that
   translates across the track when the `theme-switch-on` state is applied. */
.theme-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 3.5rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background-color: #cbd5e1;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}
.theme-switch:focus-visible {
    outline: 2px solid #7B2D3B;
    outline-offset: 2px;
}
.theme-switch-on { background-color: #7B2D3B; }
.theme-switch span {
    position: absolute;
    left: 0.25rem;
    top: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}
.theme-switch-on span { transform: translateX(1.5rem); }

/* Page swipe: let the browser keep vertical scrolling but route horizontal
   finger drags to the swipe-to-navigate handler on the finance sub-pages. */
.swipe-page { touch-action: pan-y; }

/* ============================================================
   Dark theme — scoped to a `dark` class on the document root.
   Toggled from Account settings (dark_mode pref). Every rule here
   only narrows the light theme, so leaving the class off keeps the
   existing light appearance byte-for-byte.

   Palette (matching the light slate/gray ramp, inverted):
     page bg    #0f172a (slate-900)
     surface    #1e293b (slate-800)
     elevated   #334155 (slate-700)
     border     #334155 / #475569
     text-1     #f1f5f9 (slate-100)
     text-2     #e2e8f0 (slate-200)
     text-3     #cbd5e1 (slate-300)
     text-dim   #94a3b8 (slate-400)
     text-mut   #64748b (slate-500)
   ============================================================ */
html[data-theme="dark"] body {
    background-color: #0f172a;
    color: #e2e8f0;
}

/* Surfaces ----------------------------------------------------- */
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-base-100 { background-color: #1e293b; }
html[data-theme="dark"] .card { border-color: #475569; }
html[data-theme="dark"] .bg-base-200 { background-color: #334155; }
html[data-theme="dark"] .bg-base-300 { background-color: #475569; }
html[data-theme="dark"] .bg-slate-50,
html[data-theme="dark"] .bg-gray-50 { background-color: #0f172a; }
html[data-theme="dark"] .bg-slate-100 { background-color: #1e293b; }
html[data-theme="dark"] .bg-slate-200 { background-color: #334155; }
html[data-theme="dark"] .bg-slate-300 { background-color: #475569; }
html[data-theme="dark"] .bg-indigo-50 { background-color: #1e2a44; }
html[data-theme="dark"] .bg-indigo-100 { background-color: #2b3a5e; }
html[data-theme="dark"] .bg-violet-100 { background-color: #33244d; }
html[data-theme="dark"] .bg-black\/20,
html[data-theme="dark"] .bg-black\/50,
html[data-theme="dark"] .bg-opacity-50 { background-color: rgba(0, 0, 0, 0.6); }

/* Hover surfaces ------------------------------------------------ */
html[data-theme="dark"] .hover\:bg-slate-50:hover,
html[data-theme="dark"] .hover\:bg-base-200:hover { background-color: #334155; }
html[data-theme="dark"] .hover\:bg-slate-100:hover { background-color: #334155; }
html[data-theme="dark"] .hover\:bg-slate-200:hover { background-color: #475569; }
html[data-theme="dark"] .hover\:bg-white\/30:hover { background-color: rgba(255, 255, 255, 0.08); }

/* Primary text -------------------------------------------------- */
html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-slate-900 { color: #f1f5f9; }
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-slate-800 { color: #e2e8f0; }
html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-slate-700 { color: #cbd5e1; }
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-slate-600 { color: #94a3b8; }
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-slate-500 { color: #94a3b8; }
html[data-theme="dark"] .text-gray-400,
html[data-theme="dark"] .text-slate-400 { color: #64748b; }
html[data-theme="dark"] .text-base-content { color: #e2e8f0; }
html[data-theme="dark"] .text-slate-100 { color: #f1f5f9; }
html[data-theme="dark"] .text-slate-200 { color: #e2e8f0; }
html[data-theme="dark"] .text-slate-300 { color: #cbd5e1; }
html[data-theme="dark"] .group:hover .group-hover\:text-slate-900 { color: #f1f5f9; }
html[data-theme="dark"] .group-hover-text-slate-900,
html[data-theme="dark"] .group:hover .group-hover-text-slate-900 { color: #f1f5f9; }

/* Borders ------------------------------------------------------- */
html[data-theme="dark"] .border-slate-50 { border-color: #1e293b; }
html[data-theme="dark"] .border-slate-100,
html[data-theme="dark"] .border-gray-200 { border-color: #334155; }
html[data-theme="dark"] .border-slate-200 { border-color: #334155; }
html[data-theme="dark"] .border-slate-300,
html[data-theme="dark"] .border-gray-300 { border-color: #475569; }

/* Colored status tints (soft bg + dark text -> dark bg + light text) */
html[data-theme="dark"] .bg-red-50 { background-color: #3f1a1f; }
html[data-theme="dark"] .bg-red-100 { background-color: #521e26; }
html[data-theme="dark"] .text-red-700 { color: #fca5a5; }
html[data-theme="dark"] .text-red-600 { color: #f87171; }
html[data-theme="dark"] .border-red-200 { border-color: #7f1d1d; }
html[data-theme="dark"] .hover\:bg-red-50:hover { background-color: #3f1a1f; }
html[data-theme="dark"] .hover\:bg-red-100:hover { background-color: #521e26; }

html[data-theme="dark"] .bg-emerald-50 { background-color: #062c1c; }
html[data-theme="dark"] .bg-emerald-100 { background-color: #083d27; }
html[data-theme="dark"] .text-emerald-600 { color: #34d399; }
html[data-theme="dark"] .text-emerald-700 { color: #6ee7b7; }
html[data-theme="dark"] .text-green-600 { color: #34d399; }
html[data-theme="dark"] .text-green-700 { color: #6ee7b7; }
html[data-theme="dark"] .border-emerald-200 { border-color: #064e3b; }
html[data-theme="dark"] .hover\:bg-emerald-100:hover { background-color: #083d27; }

html[data-theme="dark"] .bg-amber-50 { background-color: #2d2205; }
html[data-theme="dark"] .bg-amber-100 { background-color: #3a2c0a; }
html[data-theme="dark"] .text-amber-600 { color: #fbbf24; }
html[data-theme="dark"] .text-amber-700 { color: #fcd34d; }
html[data-theme="dark"] .text-amber-800,
html[data-theme="dark"] .text-amber-900 { color: #fcd34d; }
html[data-theme="dark"] .border-amber-200 { border-color: #78350f; }
html[data-theme="dark"] .hover\:bg-amber-100:hover { background-color: #3a2c0a; }

html[data-theme="dark"] .bg-rose-50 { background-color: #3f141e; }
html[data-theme="dark"] .bg-rose-100 { background-color: #521b2a; }
html[data-theme="dark"] .text-rose-600 { color: #fb7185; }
html[data-theme="dark"] .hover\:bg-rose-100:hover { background-color: #521b2a; }

html[data-theme="dark"] .bg-violet-50 { background-color: #2a1f4d; }

/* Brand tones on dark ------------------------------------------- */
html[data-theme="dark"] .text-sapphire { color: #7fa8d0; }
html[data-theme="dark"] .text-sapphire-dark { color: #9cc2e8; }
html[data-theme="dark"] .text-bordeaux { color: #d98a96; }
html[data-theme="dark"] .hover\:bg-bordeaux-50:hover { background-color: #3a1a20; }
html[data-theme="dark"] .hover\:bg-bordeaux-100:hover { background-color: #47202a; }
html[data-theme="dark"] .bg-bordeaux-50 { background-color: #3a1a20; }
html[data-theme="dark"] .bg-bordeaux-100 { background-color: #47202a; }
html[data-theme="dark"] .border-bordeaux { border-color: #9E4A57; }
html[data-theme="dark"] .hover\:text-bordeaux:hover { color: #d98a96; }

/* Navbar + notifications dropdown ------------------------------- */
html[data-theme="dark"] nav.bg-white { background-color: #1e293b; }
html[data-theme="dark"] .bg-white.border-gray-200 { background-color: #1e293b; }
html[data-theme="dark"] .bg-white.border-slate-200 { background-color: #1e293b; }
html[data-theme="dark"] .bg-white.border-slate-100 { background-color: #1e293b; }
html[data-theme="dark"] .bg-red-50.hover\:bg-slate-50:hover,
html[data-theme="dark"] .hover\:text-red-600:hover { color: #f87171; }

/* Inputs / selects / textareas ---------------------------------- */
html[data-theme="dark"] .input, html[data-theme="dark"] .textarea, html[data-theme="dark"] .select {
    color: #e2e8f0;
    background-color: #0f172a;
}
html[data-theme="dark"] .input-bordered,
html[data-theme="dark"] .textarea-bordered,
html[data-theme="dark"] .select-bordered {
    border-color: #475569;
    color: #e2e8f0;
    background-color: #0f172a;
}
html[data-theme="dark"] .input-bordered:focus,
html[data-theme="dark"] .textarea-bordered:focus,
html[data-theme="dark"] .select-bordered:focus {
    border-color: #7B2D3B;
    box-shadow: 0 0 0 2px rgba(123, 45, 59, 0.25);
}
html[data-theme="dark"] .select-bordered {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org\/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}
html[data-theme="dark"] .checkbox {
    background-color: #0f172a;
    border-color: #475569;
}
html[data-theme="dark"] .label-text { color: #cbd5e1; }

/* Date picker --------------------------------------------------- */
html[data-theme="dark"] .date-group .date-text,
html[data-theme="dark"] .date-pick,
html[data-theme="dark"] .date-popover { background-color: #1e293b; }
html[data-theme="dark"] .date-pick { border-color: #475569; color: #cbd5e1; }
html[data-theme="dark"] .date-pick:hover { background-color: #334155; }
html[data-theme="dark"] .date-popover { border-color: #475569; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
html[data-theme="dark"] .date-popover-title { color: #e2e8f0; }
html[data-theme="dark"] .date-popover-nav,
html[data-theme="dark"] .date-popover-close { background-color: #334155; color: #cbd5e1; }
html[data-theme="dark"] .date-popover-nav:hover,
html[data-theme="dark"] .date-popover-close:hover { background-color: #475569; }
html[data-theme="dark"] .date-popover-dow { color: #64748b; }
html[data-theme="dark"] .date-popover-day { color: #e2e8f0; }
html[data-theme="dark"] .date-popover-day:hover { background-color: #334155; }
html[data-theme="dark"] .date-popover-day-today { box-shadow: inset 0 0 0 1.5px #7fa8d0; }

/* Alerts / badges ----------------------------------------------- */
html[data-theme="dark"] .alert-error {
    background-color: #3f1a1f;
    color: #fca5a5;
    border-color: #7f1d1d;
}
html[data-theme="dark"] .alert-success {
    background-color: #062c1c;
    color: #6ee7b7;
    border-color: #064e3b;
}
html[data-theme="dark"] .badge-outline { border-color: #475569; color: #cbd5e1; }
html[data-theme="dark"] .badge-info { background-color: #1e2a44; color: #93c5fd; }
html[data-theme="dark"] .badge-success { background-color: #062c1c; color: #6ee7b7; }
html[data-theme="dark"] .badge-error { background-color: #3f1a1f; color: #fca5a5; }
html[data-theme="dark"] .badge-warning { background-color: #2d2205; color: #fcd34d; border-color: #78350f; }

/* Tables -------------------------------------------------------- */
html[data-theme="dark"] .table th { color: #cbd5e1; border-bottom-color: #334155; }
html[data-theme="dark"] .table td { color: #cbd5e1; border-bottom-color: #1e293b; }

/* Buttons ------------------------------------------------------- */
html[data-theme="dark"] .btn-outline {
    color: #9E4A57;
    border-color: #9E4A57;
}
html[data-theme="dark"] .btn-outline:hover {
    background-color: #9E4A57;
    color: #ffffff;
}
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-error,
html[data-theme="dark"] .btn-success {
    color: #ffffff;
}

/* Calendar ------------------------------------------------------ */
html[data-theme="dark"] .cal-day {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
html[data-theme="dark"] .cal-day:hover { background: #3a1a20; border-color: #9E4A57; }
html[data-theme="dark"] .cal-day-out { background: #0f172a; color: #64748b; }
html[data-theme="dark"] .cal-day-today { border-color: #7B2D3B; }
html[data-theme="dark"] .cal-day-selected, html[data-theme="dark"] .cal-day-selected:hover { background: #7B2D3B; color: #ffffff; border-color: #7B2D3B; }
html[data-theme="dark"] .cal-weekday { color: #94a3b8; }

/* Budget list item ---------------------------------------------- */
html[data-theme="dark"] .budget-list-item {
    background: #1e293b;
    border-color: #334155;
}
html[data-theme="dark"] .progress { background-color: #334155; }

/* Misc text on light cards -------------------------------------- */
html[data-theme="dark"] .navbar-link { color: #cbd5e1; }
html[data-theme="dark"] .navbar-link:hover { background-color: #2b3a5e; color: #93c5fd; }
html[data-theme="dark"] .hover\:bg-indigo-50:hover { background-color: #1e2a44; }
html[data-theme="dark"] .hover\:bg-indigo-100:hover { background-color: #2b3a5e; }

/* Theme toggle ------------------------------------------------ */
/* Dark text on a light/translucent pill; sits in the white public navbar. */
.theme-toggle {
    color: #0f172a;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(15, 23, 42, 0.15);
}
.theme-toggle:hover { background-color: rgba(255, 255, 255, 0.95); color: #0f2540; }

html[data-theme="dark"] .theme-toggle {
    color: #e2e8f0;
    background-color: #334155;
    border-color: #475569;
}
html[data-theme="dark"] .theme-toggle:hover { background-color: #475569; color: #f1f5f9; }

/* Documentation (in-app wiki) ------------------------------------ */
.doc-content { line-height: 1.7; color: #1e293b; font-size: 0.95rem; }
.doc-content > :first-child { margin-top: 0; }
.doc-content h1 { font-size: 1.75rem; font-weight: 700; color: #0f172a; margin: 0 0 1rem; }
.doc-content h2 { font-size: 1.35rem; font-weight: 700; color: #0f172a; margin: 1.75rem 0 0.6rem; padding-bottom: 0.4rem; border-bottom: 1px solid #e2e8f0; }
.doc-content h3 { font-size: 1.12rem; font-weight: 600; color: #0f172a; margin: 1.4rem 0 0.5rem; }
.doc-content h4 { font-size: 1rem; font-weight: 600; color: #0f172a; margin: 1.2rem 0 0.4rem; }
.doc-content p { margin: 0.75rem 0; }
.doc-content ul, .doc-content ol { margin: 0.75rem 0; padding-left: 1.5rem; }
.doc-content ul { list-style: disc; }
.doc-content ol { list-style: decimal; }
.doc-content li { margin: 0.3rem 0; }
.doc-content code { background: #f1f5f9; color: #7B2D3B; padding: 0.12rem 0.35rem; border-radius: 0.375rem; font-size: 0.85em; }
.doc-content pre { background: #0f172a; color: #e2e8f0; padding: 1rem 1.25rem; border-radius: 0.75rem; overflow-x: auto; margin: 1rem 0; }
.doc-content pre code { background: transparent; color: inherit; padding: 0; font-size: 0.85rem; }
.doc-content blockquote { border-left: 4px solid #C5A55A; background: #faf7ef; margin: 1rem 0; padding: 0.75rem 1rem; border-radius: 0 0.5rem 0.5rem 0; color: #57534e; }
.doc-content table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 0.9rem; }
.doc-content th, .doc-content td { border: 1px solid #e2e8f0; padding: 0.5rem 0.75rem; text-align: left; }
.doc-content th { background: #f8fafc; font-weight: 600; color: #0f172a; }
.doc-content hr { border: 0; border-top: 1px solid #e2e8f0; margin: 1.5rem 0; }
.doc-content a.doc-wiki-link { color: #7B2D3B; text-decoration: underline; text-underline-offset: 2px; }
.doc-content a.doc-wiki-link:hover { color: #5A1E2A; }
.doc-shot { display: flex; align-items: center; gap: 0.75rem; border: 1px dashed #C5A55A; background: #faf7ef; border-radius: 0.75rem; padding: 0.75rem 1rem; margin: 1rem 0; }
.doc-shot-badge { flex-shrink: 0; background: #C5A55A; color: #0f172a; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; padding: 0.2rem 0.5rem; border-radius: 999px; }
.doc-shot-text { font-size: 0.85rem; color: #57534e; }

html[data-theme="dark"] .doc-content { color: #cbd5e1; }
html[data-theme="dark"] .doc-content h1,
html[data-theme="dark"] .doc-content h2,
html[data-theme="dark"] .doc-content h3,
html[data-theme="dark"] .doc-content h4 { color: #f1f5f9; }
html[data-theme="dark"] .doc-content h2 { border-bottom-color: #334155; }
html[data-theme="dark"] .doc-content code { background: #1e293b; color: #f0a4ad; }
html[data-theme="dark"] .doc-content pre { background: #0f172a; }
html[data-theme="dark"] .doc-content blockquote { background: #1e2a44; color: #cbd5e1; }
html[data-theme="dark"] .doc-content th, html[data-theme="dark"] .doc-content td { border-color: #334155; }
html[data-theme="dark"] .doc-content th { background: #1e293b; color: #f1f5f9; }
html[data-theme="dark"] .doc-content hr { border-top-color: #334155; }
html[data-theme="dark"] .doc-content a.doc-wiki-link { color: #f0a4ad; }
html[data-theme="dark"] .doc-content a.doc-wiki-link:hover { color: #f7c6cc; }
html[data-theme="dark"] .doc-shot { background: #1e2a44; border-color: #A88B3E; }
html[data-theme="dark"] .doc-shot-badge { background: #A88B3E; color: #0f172a; }
html[data-theme="dark"] .doc-shot-text { color: #cbd5e1; }

/* Missing color utilities referenced by the UI (completed 2026-08-12) ----- */
.bg-slate-400 { background-color: #94a3b8; }
.bg-slate-500 { background-color: #64748b; }
.bg-slate-700 { background-color: #334155; }
.text-emerald-800 { color: #065f46; }
.text-red-500 { color: #ef4444; }
.text-red-800 { color: #991b1b; }
.text-rose-700 { color: #be123c; }
.text-rose-800 { color: #9f1239; }
.text-sapphire-700 { color: #16324f; }
.text-neutral-content { color: #64748b; }
.bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.1); }
.bg-red-500\/10 { background-color: rgba(239, 68, 68, 0.1); }
.border-emerald-500\/40 { border-color: rgba(16, 185, 129, 0.4); }
.border-red-500\/40 { border-color: rgba(239, 68, 68, 0.4); }
.divide-slate-200 > :not([hidden]) ~ :not([hidden]) { border-color: #e2e8f0; }
.hover\:bg-amber-200:hover { background-color: #fde68a; }
.hover\:bg-emerald-200:hover { background-color: #a7f3d0; }
.hover\:bg-emerald-700:hover { background-color: #047857; }
.hover\:bg-rose-200:hover { background-color: #fecdd3; }
.hover\:bg-slate-600:hover { background-color: #475569; }

/* Dark-scoped `dark:` variants (same semantics as Tailwind) --------------- */
html[data-theme="dark"] .dark\:bg-amber-900\/30 { background-color: rgba(120, 53, 15, 0.3); }
html[data-theme="dark"] .dark\:bg-amber-900\/40 { background-color: rgba(120, 53, 15, 0.4); }
html[data-theme="dark"] .dark\:bg-emerald-900\/40 { background-color: rgba(6, 95, 70, 0.4); }
html[data-theme="dark"] .dark\:bg-rose-900\/30 { background-color: rgba(136, 19, 55, 0.3); }
html[data-theme="dark"] .dark\:bg-rose-900\/40 { background-color: rgba(136, 19, 55, 0.4); }
html[data-theme="dark"] .dark\:bg-slate-700 { background-color: #334155; }
html[data-theme="dark"] .dark\:bg-slate-800\/40 { background-color: rgba(30, 41, 59, 0.4); }
html[data-theme="dark"] .dark\:bg-slate-800\/50 { background-color: rgba(30, 41, 59, 0.5); }
html[data-theme="dark"] .dark\:border-gray-600 { border-color: #4b5563; }
html[data-theme="dark"] .dark\:border-slate-600 { border-color: #475569; }
html[data-theme="dark"] .dark\:text-amber-200 { color: #fde68a; }
html[data-theme="dark"] .dark\:text-amber-300 { color: #fcd34d; }
html[data-theme="dark"] .dark\:text-amber-400 { color: #fbbf24; }
html[data-theme="dark"] .dark\:text-emerald-300 { color: #6ee7b7; }
html[data-theme="dark"] .dark\:text-emerald-400 { color: #34d399; }
html[data-theme="dark"] .dark\:text-gray-300 { color: #d1d5db; }
html[data-theme="dark"] .dark\:text-red-300 { color: #fca5a5; }
html[data-theme="dark"] .dark\:text-red-400 { color: #f87171; }
html[data-theme="dark"] .dark\:text-rose-200 { color: #fecdd3; }
html[data-theme="dark"] .dark\:text-rose-300 { color: #fda4af; }
html[data-theme="dark"] .dark\:hover\:bg-rose-800\/50:hover { background-color: rgba(159, 18, 57, 0.5); }
html[data-theme="dark"] .dark\:hover\:bg-slate-600:hover { background-color: #475569; }



