/* style.css – Complete Dark Mode Glassmorphism Overhaul */

/* ============================================================
   Design Tokens (Light & Dark Theme)
   ============================================================ */
:root {
    /* Base Colors (Brand - Ice Blue & Pink) */
    --clr-primary: #38BDF8; /* Ice Blue / Sky 400 */
    --clr-primary-alt: #F472B6; /* Pink 400 */
    --clr-primary-hover: #0284C7; /* Darker Blue */
    --clr-secondary: #6366F1; /* Indigo */
    --clr-danger: #F43F5E; /* Rose */
    --clr-warning: #F59E0B; /* Amber */
    --clr-info: #3B82F6; /* Blue */
    
    /* Light Mode Palette */
    --clr-bg-body: #FCF8FA; /* Light Ice Pink - Decreased */
    --clr-bg-card: rgba(255, 255, 255, 0.85); /* Whiter */
    --clr-bg-input: rgba(255, 255, 255, 1); /* Fully opaque for text boxes */
    --clr-border: rgba(244, 114, 182, 0.15); /* Weaker pink border */
    --clr-border-highlight: rgba(244, 114, 182, 0.3);
    
    /* Light Text Colors */
    --clr-text-main: #0F172A; /* Slate 900 */
    --clr-text-muted: #64748B; /* Slate 500 */
    --clr-text-label: #334155; /* Slate 700 */
    
    /* Hover state */
    --clr-bg-hover: rgba(255, 255, 255, 1);
    
    /* Utility Translations */
    --util-text-white: #0F172A;
    --util-text-gray-100: #1E293B;
    --util-text-gray-200: #334155;
    --util-text-gray-300: #475569;
    --util-text-gray-400: #64748B;
    --util-bg-gray-800: rgba(255, 255, 255, 0.85);
    --util-bg-gray-900: rgba(253, 244, 248, 0.9);
    --util-bg-white: #FDF4F8;
    
    /* Mesh Background (Ice Pink + Sky Blue - Stronger Gradient) */
    --mesh-bg: 
        radial-gradient(circle at 15% 50%, rgba(244, 114, 182, 0.1), transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(56, 189, 248, 0.15), transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(232, 121, 249, 0.1), transparent 50%);
    
    --radius: 20px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 12px 40px 0 rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] {
    /* Dark Mode Palette */
    --clr-bg-body: #0F172A; /* Slate 900 */
    --clr-bg-card: rgba(30, 41, 59, 0.4); /* Slate 800 semi-transparent */
    --clr-bg-input: rgba(15, 23, 42, 0.6);
    --clr-border: rgba(255, 255, 255, 0.08);
    --clr-border-highlight: rgba(255, 255, 255, 0.15);
    
    /* Dark Text Colors */
    --clr-text-main: #F8FAFC; /* Slate 50 */
    --clr-text-muted: #94A3B8; /* Slate 400 */
    --clr-text-label: #CBD5E1; /* Slate 300 */
    
    /* Hover state */
    --clr-bg-hover: rgba(30, 41, 59, 0.8);
    
    /* Utility Translations */
    --util-text-white: #ffffff;
    --util-text-gray-100: #F1F5F9;
    --util-text-gray-200: #E2E8F0;
    --util-text-gray-300: var(--clr-text-label);
    --util-text-gray-400: var(--clr-text-muted);
    --util-bg-gray-800: rgba(30, 41, 59, 0.8);
    --util-bg-gray-900: rgba(15, 23, 42, 0.9);
    --util-bg-white: #ffffff;
    
    /* Mesh Background (Dark Emerald & Indigo) */
    --mesh-bg: 
        radial-gradient(circle at 15% 50%, rgba(16, 185, 129, 0.1), transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(99, 102, 241, 0.1), transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(244, 63, 94, 0.05), transparent 50%);
    
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* ============================================================
   Base Reset
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--clr-bg-body);
    color: var(--clr-text-main);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    transition: background-color var(--transition), color var(--transition);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Ambient Animated Mesh Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: var(--mesh-bg);
    animation: meshFlow 15s ease-in-out infinite alternate;
    transition: background var(--transition);
}

@keyframes meshFlow {
    0% { transform: scale(1) translate(0px, 0px); }
    50% { transform: scale(1.1) translate(20px, -20px); }
    100% { transform: scale(1) translate(-20px, 20px); }
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

svg {
    display: inline-block;
}

/* ============================================================
   Layout Utilities
   ============================================================ */
.max-w-md { max-width: 28rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-start { align-items: flex-start; }

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

@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)); }
    .md\:flex-row { flex-direction: row; }
    .md\:w-auto { width: auto; }
}

@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\:col-span-1 { grid-column: span 1 / span 1; }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
}

.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

.space-x-1 > * + * { margin-left: 0.25rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.sticky { position: sticky; }
.top-0 { top: 0; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.max-h-96 { max-height: 24rem; }
.h-fit { height: fit-content; }
.whitespace-nowrap { white-space: nowrap; }

/* ============================================================
   Sizing Utilities
   ============================================================ */
.w-full { width: 100%; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.w-20 { width: 5rem; max-width: 100%; }
.h-20 { height: 5rem; max-height: 100%; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }

.flex-1 { flex: 1 1 0%; }

/* ============================================================
   Spacing Utilities
   ============================================================ */
.p-1\.5 { padding: 0.375rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-auto { margin-top: auto; }

.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; }

.ml-2 { margin-left: 0.5rem; }
.ml-4 { margin-left: 1rem; }
.mr-1\.5 { margin-right: 0.375rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.pt-4 { padding-top: 1rem; }
.pb-6 { padding-bottom: 1.5rem; }

/* ============================================================
   Typography Utilities
   ============================================================ */
.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-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.capitalize { text-transform: capitalize; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }

.text-white { color: var(--util-text-white); }
.text-black { color: #000000; }

/* Translated Colors for Dark/Light Mode */
.text-gray-100 { color: var(--util-text-gray-100); }
.text-gray-200 { color: var(--util-text-gray-200); }
.text-gray-300 { color: var(--util-text-gray-300); } 
.text-gray-400 { color: var(--util-text-gray-400); }
.text-gray-500 { color: #64748B; }
.text-gray-600 { color: #475569; }
.text-gray-700 { color: #334155; }
.text-gray-800 { color: #1E293B; }

.text-green-400 { color: var(--clr-primary); }
.text-green-500 { color: var(--clr-primary-hover); }
.text-blue-400 { color: var(--clr-info); }
.text-blue-500 { color: #2563EB; }
.text-purple-400 { color: #A78BFA; }
.text-purple-500 { color: #8B5CF6; }
.text-yellow-300 { color: #FDE047; }
.text-yellow-400 { color: var(--clr-warning); }
.text-red-400 { color: #F87171; }
.text-red-500 { color: var(--clr-danger); }

/* ============================================================
   Backgrounds & Borders
   ============================================================ */
.bg-white { background-color: var(--util-bg-white); }
.bg-gray-50 { background-color: rgba(120,120,120,0.05); } 
.bg-gray-800 { background-color: var(--util-bg-gray-800); }
.bg-gray-800\/40 { background-color: var(--clr-bg-card); }
.bg-gray-800\/60 { background-color: var(--clr-bg-card); }
.bg-gray-900\/50 { background-color: var(--util-bg-gray-900); }
.bg-gray-900\/90 { background-color: var(--util-bg-gray-900); }

/* Remap green utilities to Ice Blue/Pink theme */
.bg-green-500 { background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-alt)) !important; }
.text-green-400, .text-green-500 { color: var(--clr-primary) !important; }
.border-green-500 { border-color: var(--clr-primary) !important; }
.hover\:bg-green-600:hover { background: linear-gradient(135deg, var(--clr-primary-alt), var(--clr-primary)) !important; }
.hover\:text-green-400:hover { color: var(--clr-primary-alt) !important; }
.focus\:ring-green-500:focus { box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.4) !important; border-color: var(--clr-primary) !important; }

.bg-indigo-500 { background-color: var(--clr-secondary); }
.bg-yellow-500 { background-color: var(--clr-warning); }

.bg-green-500\/20 { background-color: rgba(16, 185, 129, 0.2); }
.bg-yellow-500\/20 { background-color: rgba(245, 158, 11, 0.2); }
.bg-red-400\/10 { background-color: rgba(248, 113, 113, 0.1); }
.bg-red-400\/20 { background-color: rgba(248, 113, 113, 0.2); }
.bg-red-500 { background-color: var(--clr-danger); }
.bg-transparent { background-color: transparent; }

.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-l { border-left-width: 1px; border-left-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-0 { border-width: 0; }

.border-gray-200, .border-gray-300 { border-color: var(--clr-border); }
.border-white\/5 { border-color: var(--clr-border); }
.border-white\/10 { border-color: var(--clr-border); }
.border-white\/20 { border-color: var(--clr-border-highlight); }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-md); }
.rounded-xl { border-radius: var(--radius); }
.rounded-2xl { border-radius: 24px; }
.rounded-full { border-radius: 9999px; }

/* ============================================================
   Glass Card & Containers
   ============================================================ */
.glass {
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.glass:not(nav) {
    position: relative;
    overflow: hidden;
}

/* Cards Side Color Effect with Gradient */
.glass:not(nav)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--clr-primary) 0%, #f472b6 100%);
    box-shadow: 2px 0 15px rgba(56, 189, 248, 0.5);
    z-index: 0;
    pointer-events: none;
}

[data-theme="light"] .glass:not(nav)::before {
    box-shadow: 2px 0 15px rgba(244, 114, 182, 0.5);
}
.glass:hover {
    border-color: var(--clr-border-highlight);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   Buttons & Links
   ============================================================ */
.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-alt));
    color: #fff !important;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
    position: relative;
    overflow: hidden;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(244, 114, 182, 0.4);
    background: linear-gradient(135deg, var(--clr-primary-alt), var(--clr-primary));
}
.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    transform: rotate(30deg) translate(-100%, -100%);
    transition: all 0.6s ease;
}
.btn-primary:hover::after {
    transform: rotate(30deg) translate(100%, 100%);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(255,255,255,0.3);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-danger {
    display: inline-block;
    background-color: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--clr-danger);
    padding: 0.375rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition);
}
.btn-danger:hover {
    background-color: rgba(244, 63, 94, 0.2);
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.2);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--clr-border);
    color: var(--clr-text-main);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all var(--transition);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--clr-border-highlight);
    transform: translateY(-1px);
}

/* Hover Utilities */
.hover\:text-green-400:hover { color: var(--clr-primary); }
.hover\:text-white:hover { color: var(--util-text-white); text-shadow: 0 0 10px rgba(0,0,0,0.1); }
[data-theme="dark"] .hover\:text-white:hover { text-shadow: 0 0 10px rgba(255,255,255,0.3); }
.hover\:bg-green-600:hover { background-color: var(--clr-primary-hover); }
.hover\:bg-indigo-600:hover { background-color: #4F46E5; }
.hover\:shadow-lg:hover { box-shadow: 0 10px 25px rgba(0,0,0,0.4); }
.hover\:underline:hover { text-decoration: underline; }

.transition { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 300ms; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 300ms; }
.group:hover .group-hover\:text-blue-600 { color: #3B82F6; }
.group:hover .group-hover\:text-purple-600 { color: #A855F7; }
.group:hover .group-hover\:text-yellow-400 { color: var(--clr-warning); }
.group:hover .group-hover\:text-gray-300 { color: var(--util-text-gray-300); }

/* ============================================================
   Form Inputs
   ============================================================ */
.form-input {
    width: 100%;
    background: var(--clr-bg-input);
    border: 2px solid var(--clr-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--clr-text-main);
    font-family: inherit;
    transition: all var(--transition);
    outline: none;
    backdrop-filter: blur(8px);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.form-input::placeholder {
    color: var(--clr-text-muted);
}
.form-input:focus {
    background: var(--clr-bg-card);
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}
select.form-input option {
    background: #1E293B;
    color: #fff;
}

.file\:mr-3::file-selector-button { margin-right: 0.75rem; cursor: pointer;}
.file\:py-1::file-selector-button { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.file\:px-3::file-selector-button { padding-left: 1rem; padding-right: 1rem; }
.file\:rounded-md::file-selector-button { border-radius: 0.5rem; }
.file\:border-0::file-selector-button { border-width: 0; }
.file\:text-sm::file-selector-button { font-size: 0.875rem; font-weight: 600; }
.file\:bg-green-500::file-selector-button { background-color: var(--clr-primary); }
.file\:text-white::file-selector-button { color: #ffffff; }
.hover\:file\:bg-green-600:hover::file-selector-button { background-color: var(--clr-primary-hover); }

/* ============================================================
   Tables (Modern List View)
   ============================================================ */
.table-hover { width: 100%; border-collapse: separate; border-spacing: 0 0.5rem; text-align: left; }
.table-hover thead tr { background: transparent; }
.table-hover th { padding: 0.75rem 1.25rem; color: var(--clr-text-muted); font-weight: 600; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; border: none; }
.table-hover tbody tr {
    background: var(--clr-bg-card);
    transition: all var(--transition);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.table-hover tbody tr td:first-child { border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
.table-hover tbody tr td:last-child { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
.table-hover td { padding: 1rem 1.25rem; border: none; border-top: 1px solid var(--clr-border); border-bottom: 1px solid var(--clr-border); }

.table-hover tbody tr:hover {
    background: var(--clr-bg-hover);
    transform: translateY(-2px) scale(1.005);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

/* Custom Checkbox */
input[type="checkbox"] {
    appearance: none;
    background-color: var(--clr-bg-input);
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.15em;
    height: 1.15em;
    border: 1px solid var(--clr-border-highlight);
    border-radius: 0.25em;
    display: inline-grid;
    place-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
input[type="checkbox"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--clr-primary);
    background-color: var(--clr-primary);
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
input[type="checkbox"]:checked { border-color: var(--clr-primary); }
input[type="checkbox"]:checked::before { transform: scale(1); }

/* ============================================================
   Status Badges
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 1px currentColor;
    background: rgba(0,0,0,0.2);
}
.badge-sent    { color: #4ADE80; box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.4), 0 0 10px rgba(74, 222, 128, 0.2); }
.badge-pending { color: #FBBF24; box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.4), 0 0 10px rgba(251, 191, 36, 0.2); }
.badge-failed  { color: #F87171; box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.4), 0 0 10px rgba(248, 113, 113, 0.2); }
.badge-admin   { color: #FBBF24; }
.badge-user    { color: #60A5FA; }

/* ============================================================
   Alert Banners (Toasts)
   ============================================================ */
.alert {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 9999;
    min-width: 320px;
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: slideInRight 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, fadeOut 0.6s ease-in 5s forwards;
    pointer-events: none;
    border: 1px solid;
}
.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #A7F3D0;
    border-left: 4px solid var(--clr-primary);
}
[data-theme="light"] .alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #064e3b;
}

.alert-error {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.3);
    color: #FDA4AF;
    border-left: 4px solid var(--clr-danger);
}
[data-theme="light"] .alert-error {
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.4);
    color: #881337;
}
.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #FDE68A;
    border-left: 4px solid var(--clr-warning);
}

@keyframes slideInRight {
    from { transform: translateX(120%) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; visibility: hidden; transform: translateY(-20px) scale(0.9); }
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); filter: blur(5px); }
    to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}
.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
}

@keyframes pulse-red {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(244, 63, 94, 0.4)); }
    50%      { filter: drop-shadow(0 0 10px rgba(244, 63, 94, 0.8)); }
}
.animate-pulse {
    animation: pulse-red 2s infinite;
}

/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* ============================================================
   Navbar Specific (Floating Pill)
   ============================================================ */
nav.glass {
    background: var(--clr-bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--clr-border);
    box-shadow: var(--shadow-soft);
    border-radius: 100px;
    margin: 1rem auto;
    max-width: calc(100% - 2rem);
    width: 1280px;
}
nav a.transition {
    position: relative;
}
nav a.transition::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--clr-primary);
    transition: width 0.3s ease;
}
nav a.transition:hover::after {
    width: 80%;
}

/* ============================================================
   Navigation & Dropdown
   ============================================================ */
.nav-link {
    display: flex;
    align-items: center;
    color: var(--clr-text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition);
    padding: 0.5rem 1rem;
    border-radius: 9999px; /* Fully rounded pill */
    position: relative;
}

.nav-link:hover {
    color: var(--clr-text-main);
    background: rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--clr-primary);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(244, 114, 182, 0.1));
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-alt));
    box-shadow: 0 0 8px var(--clr-primary);
}

.nav-link.active svg {
    filter: drop-shadow(0 0 6px currentColor);
    opacity: 1 !important;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5), 0 0 15px rgba(56, 189, 248, 0.1);
    min-width: 200px;
    z-index: 100;
    padding: 0.5rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Invisible bridge to prevent dropdown from closing when traversing the gap */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -0.75rem;
    left: 0;
    width: 100%;
    height: 1rem;
}

[data-theme="light"] .dropdown-content {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(244, 114, 182, 0.2);
    box-shadow: 0 10px 40px -10px rgba(244, 114, 182, 0.2), 0 0 15px rgba(56, 189, 248, 0.1);
}

.dropdown:hover .dropdown-content {
    display: block;
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    position: relative;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: var(--clr-text-main);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    background: transparent !important;
}

.dropdown-item::after {
    content: '';
    position: absolute;
    bottom: 0.25rem;
    left: 1.25rem;
    width: 0;
    height: 2px;
    background: var(--clr-primary);
    transition: width 0.3s ease;
}

.dropdown-item:hover {
    color: var(--clr-primary);
}

.dropdown-item:hover::after, .dropdown-item.active::after {
    width: calc(100% - 2.5rem);
}

.dropdown-item.active {
    color: var(--clr-primary);
    font-weight: 700;
}
.dropdown-item.active svg {
    filter: drop-shadow(0 0 4px currentColor);
}

/* ============================================================
   Mobile Bottom Navigation
   ============================================================ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 0.5rem 1rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
}

[data-theme="light"] .mobile-bottom-nav {
    background: rgba(253, 244, 248, 0.9);
    border-top: 1px solid rgba(244, 114, 182, 0.2);
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--clr-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    flex: 1;
}

.mobile-nav-link svg {
    margin-bottom: 0.25rem;
    opacity: 0.5;
    transition: all 0.2s;
    filter: grayscale(0.5);
}

.mobile-nav-link.active {
    color: var(--clr-text-main);
}

.mobile-nav-link.active svg {
    opacity: 1;
    filter: grayscale(0) drop-shadow(0 0 5px currentColor);
    transform: translateY(-2px);
}

@media (max-width: 1024px) {
    .mobile-bottom-nav {
        display: flex;
        justify-content: space-between;
    }
    
    .desktop-nav-links {
        display: none !important;
    }
    
    body {
        padding-bottom: 5rem; /* Space for bottom nav */
    }
}

.dropdown-item svg {
    margin-right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    opacity: 0.7;
}

.dropdown-item:first-child {
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

.dropdown-item:last-child {
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

/* Language Selector Menu */
.lang-select {
    background-color: var(--clr-bg-input);
    color: var(--clr-text-main);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.lang-select:focus {
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.lang-select option {
    background-color: var(--clr-bg-card);
    color: var(--clr-text-main);
}
