/* ==========================================================================
   TABLE OF CONTENTS
   ==========================================================================
   1. IMPORTS & RESET ......... Fonts, Box-sizing, Reset
   2. VARIABLES ............... Color Palette, Theming (Light/Dark), Dimensions
   3. CORE STYLES ............. Body, Typography, Transitions
   4. UI ELEMENTS ............. Scrollbars, Background Blobs
   5. UTILITIES ............... Spacing, Glassmorphism, Visibility
   6. LAYOUT .................. Main Dashboard Structure
   7. SIDEBAR MODULE .......... Container, Logo, Navigation, Profile, Footer
   8. MOBILE COMPONENTS ....... Toggles, Overlays
   9. RESPONSIVE DESIGN ....... Media Queries & Mobile Adaptations
   ========================================================================== */

/* =========================================
   1. IMPORTS & RESET
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Helper to kill transitions during theme toggle or load */
.no-transition,
.no-transition * {
  transition: none !important;
}


/* =========================================
   2. VARIABLES (THEMING)
   ========================================= */
:root {
  /* --- Light Mode Palette --- */
  --bg-color: #f0f2f5;
  --text-color: #1a1a1a;
  --text-muted: #64748b;
  
  /* --- Glass Effect --- */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.05);

  /* --- Accents & Graphics --- */
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --blob-1: #ff9a9e;
  --blob-2: #fad0c4;

  /* --- Layout Dimensions --- */
  --sidebar-width: 240px;
  --header-height: 60px;
}

[data-theme="dark"] {
  /* --- Dark Mode Palette --- */
  --bg-color: #0f172a;
  --text-color: #e2e8f0;
  --text-muted: #94a3b8;

  /* --- Glass Effect --- */
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.2);

  /* --- Accents & Graphics --- */
  --accent: #818cf8;
  --accent-hover: #6366f1;
  --blob-1: #4338ca;
  --blob-2: #3b82f6;
}


/* =========================================
   3. CORE STYLES
   ========================================= */
body {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* =========================================
   4. UI ELEMENTS (Backgrounds & Scrollbars)
   ========================================= */

/* --- Animated Background Blobs --- */
.background-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  filter: blur(90px);
  opacity: 0.5;
  animation: float 12s infinite ease-in-out alternate;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: var(--blob-1);
  border-radius: 40% 50% 30% 40%;
}

.blob-2 {
  bottom: -10%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: var(--blob-2);
  border-radius: 60% 40% 30% 50%;
  animation-delay: -5s;
}

@keyframes float {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(30px, 40px) rotate(8deg); }
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}


/* =========================================
   5. UTILITIES
   ========================================= */

/* --- Visual Effects --- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--glass-shadow);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.hidden {
  display: none !important;
}

/* --- Spacing System --- */
/* Margin Bottom (mb) */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; } /* 4px */
.mb-2 { margin-bottom: 0.5rem !important; }  /* 8px */
.mb-3 { margin-bottom: 1rem !important; }    /* 16px */
.mb-4 { margin-bottom: 1.5rem !important; }  /* 24px */
.mb-5 { margin-bottom: 2rem !important; }    /* 32px */
.mb-6 { margin-bottom: 3rem !important; }    /* 48px */
.mb-7 { margin-bottom: 4rem !important; }    /* 64px */

/* Margin Top (mt) */
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 2rem !important; }
.mt-6 { margin-top: 3rem !important; }

.text-color { color: var(--text-color) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-accent { color: var(--accent) !important; }
.text-decoration-none { text-decoration: none !important; }

/* --- Reusable Layout Utilities --- */
.d-block { display: block !important; }
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-grid { display: grid !important; }
.flex-col { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-1 { flex: 1 !important; }
.flex-2 { flex: 2 !important; }
.shrink-0 { flex-shrink: 0 !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.items-end { align-items: flex-end !important; }
.items-baseline { align-items: baseline !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.align-start { align-self: start !important; }
.pos-relative { position: relative !important; }
.pos-absolute { position: absolute !important; }
.pos-static { position: static !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-x-auto { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
.overflow-y-auto { overflow-y: auto !important; }
.w-full { width: 100% !important; }
.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }
.w-fit { width: fit-content !important; }
.w-120 { width: 120px !important; }
.w-130 { width: 130px !important; }
.w-140 { width: 140px !important; }
.w-150 { width: 150px !important; }
.h-full { height: 100% !important; }
.h-auto { height: auto !important; }
.h-fit { height: fit-content !important; }
.h-50 { height: 50px !important; }
.h-120 { height: 120px !important; }
.h-150 { height: 150px !important; }
.size-32 { width: 32px !important; height: 32px !important; }
.size-40 { width: 40px !important; height: 40px !important; }
.size-45 { width: 45px !important; height: 45px !important; }
.size-46 { width: 46px !important; height: 46px !important; }
.size-50 { width: 50px !important; height: 50px !important; }
.size-20 { width: 20px !important; height: 20px !important; }
.size-80 { width: 80px !important; height: 80px !important; }
.min-w-150 { min-width: 150px !important; }
.min-w-180 { min-width: 180px !important; }
.min-w-200 { min-width: 200px !important; }
.min-w-250 { min-width: 250px !important; }
.min-w-600 { min-width: 600px !important; }
.min-w-700 { min-width: 700px !important; }
.max-w-full { max-width: 100% !important; }
.max-w-200 { max-width: 200px !important; }
.max-w-500 { max-width: 500px !important; }
.max-w-600 { max-width: 600px !important; }
.max-w-1200 { max-width: 1200px !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.mt-auto { margin-top: auto !important; }
.mr-2 { margin-right: 0.5rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-auto { margin-left: auto !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-5 { gap: 1.5rem !important; }
.gap-6 { gap: 2rem !important; }
.gap-8 { gap: 3rem !important; }
.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 2rem !important; }
.p-6 { padding: 2.5rem !important; }
.p-7 { padding: 3rem !important; }
.p-8 { padding: 4rem !important; }
.py-hero { padding: 4rem 2rem !important; }
.px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.pxy-sm { padding: 0.4rem 0.8rem !important; }
.card-pad { padding: 1.25rem 1rem !important; }
.pt-4 { padding-top: 1.5rem !important; }
.pt-5 { padding-top: 2rem !important; }
.pb-3 { padding-bottom: 1rem !important; }
.pl-4 { padding-left: 1.5rem !important; }
.pl-5 { padding-left: 20px !important; }
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.font-mono { font-family: monospace !important; }
.font-400 { font-weight: 400 !important; }
.font-500 { font-weight: 500 !important; }
.font-600 { font-weight: 600 !important; }
.font-700 { font-weight: 700 !important; }
.font-800 { font-weight: 800 !important; }
.italic { font-style: italic !important; }
.text-xs { font-size: 0.75rem !important; }
.text-sm { font-size: 0.85rem !important; }
.text-md { font-size: 0.9rem !important; }
.text-base { font-size: 1rem !important; }
.text-lg { font-size: 1.1rem !important; }
.text-xl { font-size: 1.2rem !important; }
.text-2xl { font-size: 1.5rem !important; }
.text-3xl { font-size: 1.8rem !important; }
.text-4xl { font-size: 2.5rem !important; }
.text-5xl { font-size: 3rem !important; }
.leading-none { line-height: 1 !important; }
.leading-tight { line-height: 1.2 !important; }
.leading-relaxed { line-height: 1.6 !important; }
.leading-loose { line-height: 1.8 !important; }
.uppercase { text-transform: uppercase !important; }
.text-uppercase { text-transform: uppercase !important; }
.capitalize { text-transform: capitalize !important; }
.tracking { letter-spacing: 1px !important; }
.tracking-wide { letter-spacing: 5px !important; }
.tracking-tight { letter-spacing: -0.5px !important; }
.tracking-tighter { letter-spacing: -1px !important; }
.nowrap { white-space: nowrap !important; }
.truncate { white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
.rounded-sm { border-radius: 6px !important; }
.rounded { border-radius: 8px !important; }
.rounded-md { border-radius: 10px !important; }
.rounded-lg { border-radius: 12px !important; }
.rounded-xl { border-radius: 16px !important; }
.rounded-2xl { border-radius: 20px !important; }
.rounded-full { border-radius: 50% !important; }
.border { border: 1px solid var(--glass-border) !important; }
.border-top { border-top: 1px solid var(--glass-border) !important; }
.border-bottom { border-bottom: 1px solid var(--glass-border) !important; }
.border-none { border: none !important; }
.shadow-glass { box-shadow: var(--glass-shadow) !important; }
.object-cover { object-fit: cover !important; }
.object-contain { object-fit: contain !important; }
.pointer-none { pointer-events: none !important; }
.cursor-pointer { cursor: pointer !important; }
.z-2 { z-index: 2 !important; }
.grid-full { grid-column: 1 / -1 !important; }
.my-2 { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; }
.my-3 { margin-top: 0.75rem !important; margin-bottom: 0.75rem !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.m-0 { margin: 0 !important; }
.mr-auto { margin-right: auto !important; }
.opacity-50 { opacity: 0.5 !important; }
.opacity-05 { opacity: 0.05 !important; }
.opacity-70 { opacity: 0.7 !important; }
.opacity-80 { opacity: 0.8 !important; }
.aspect-poster { aspect-ratio: 2 / 3 !important; }
.aspect-profile { aspect-ratio: 4 / 5 !important; }
.bg-page { background: var(--bg-color) !important; }
.bg-glass { background: var(--glass-bg) !important; }
.bg-border { background: var(--glass-border) !important; }
.bg-soft { background: rgba(0,0,0,0.02) !important; }
.bg-muted { background: rgba(0,0,0,0.05) !important; }
.bg-accent-soft { background: rgba(99, 102, 241, 0.1) !important; }
.bg-success-soft { background: rgba(34, 197, 94, 0.1) !important; }
.bg-warning-soft { background: rgba(234, 179, 8, 0.1) !important; }
.bg-danger-soft { background: rgba(239, 68, 68, 0.1) !important; }
.bg-brand-gradient { background: linear-gradient(135deg, var(--accent), var(--blob-1)) !important; }
.bg-faint-gradient { background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(236, 72, 153, 0.05)) !important; }
.bg-soft-gradient { background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(236,72,153,0.1)) !important; }
.bg-brand-radial { background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, rgba(0,0,0,0) 70%) !important; }
.bg-pink-radial { background: radial-gradient(circle, rgba(236,72,153,0.15) 0%, rgba(0,0,0,0) 70%) !important; }
.bg-amber-soft { background: rgba(245, 158, 11, 0.1) !important; }
.bg-pink { background: rgba(236, 72, 153, 0.1) !important; }
.bg-accent { background: var(--accent) !important; }
.bg-error { background: #ef4444 !important; }
.text-success { color: #22c55e !important; }
.text-warning { color: #eab308 !important; }
.text-danger { color: #ef4444 !important; }
.text-error { color: #ef4444 !important; }
.text-pink { color: #ec4899 !important; }
.text-blue { color: #3b82f6 !important; }
.text-purple { color: #a855f7 !important; }
.text-white { color: #ffffff !important; }
.top-4 { top: 4px !important; }
.top-neg-half { top: -50% !important; }
.left-neg-dot { left: -27px !important; }
.left-20 { left: 20% !important; }
.left-half { left: 50% !important; }
.left-80 { left: 80% !important; }
.translate-x-half { transform: translateX(-50%) !important; }
.profile-overlap { margin-top: -80px; }
.timeline-line { border-left: 2px solid var(--glass-border); padding-left: 20px; }
.h-1 { height: 1px !important; }
.h-12 { height: 12px !important; }
.h-300 { height: 300px !important; }
.h-400 { height: 400px !important; }
.h-800 { height: 800px !important; }
.w-12 { width: 12px !important; }
.w-300 { width: 300px !important; }
.w-400 { width: 400px !important; }
.w-800 { width: 800px !important; }
.max-h-400 { max-height: 400px !important; }
.max-h-500 { max-height: 500px !important; }
.min-h-250 { min-height: 250px !important; }
.btn-pad-lg { padding: 0.75rem 2rem !important; }
.btn-pad-xl { padding: 12px 24px !important; }
.hero-pad { padding: 5rem 2rem !important; }
.empty-pad { padding: 3rem 1rem !important; }
.thumb-pad { padding: 4px !important; }
.border-warning { border: 1px solid rgba(234, 179, 8, 0.2) !important; }
.border-danger { border: 1px solid rgba(239, 68, 68, 0.3) !important; }
.border-error { border: 1px solid rgba(239, 68, 68, 0.35) !important; }
.border-subtle { border: 1px solid rgba(255,255,255,0.1) !important; }
.border-bg-2 { border: 2px solid var(--bg-color) !important; }
.border-bg-4 { border: 4px solid var(--bg-color) !important; }
.border-glass-2 { border: 2px solid var(--glass-border) !important; }
.row-border { border-bottom: 1px solid rgba(255,255,255,0.05) !important; }
.head-border { border-bottom: 1px solid rgba(255,255,255,0.1) !important; }
.fit-cover { width: 100%; height: 100%; object-fit: cover; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.transition-color { transition: color 0.2s !important; }
.transition-transform { transition: transform 0.3s ease !important; }
.align-middle { vertical-align: middle !important; }
.accent-link { color: var(--accent) !important; }
.profile-cover {
    height: 320px;
    background: rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}
.profile-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.profile-cover-empty {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
    backdrop-filter: blur(10px);
}
.profile-avatar-lg {
    width: 150px;
    height: 150px;
    border-radius: 20px;
    border: 4px solid var(--bg-color);
    box-shadow: var(--glass-shadow);
    object-fit: cover;
    background: var(--glass-bg);
    flex-shrink: 0;
}
.avatar-md-square {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--glass-border);
}
.poster-type-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 6px;
}
.success-action {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
}
.social-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    padding: 6px 12px;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.social-badge img {
    display: block;
}
.row-title {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
}
/* --- Reusable Components --- */
.two-col { grid-template-columns: 1fr 1fr !important; gap: 1.5rem !important; }
.birth-grid { grid-template-columns: 1fr 1fr 1.5fr !important; gap: 0.5rem !important; margin-bottom: 1rem !important; }
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important; gap: 1.5rem !important; margin-bottom: 2rem !important; }
.cards-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important; gap: 1.5rem !important; }
.content-sidebar-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important; gap: 2rem !important; }

/* =========================================
   6A. PAGE COMPONENTS (SEGREGATED)
   ========================================= */

/* Layout columns used in create/edit/detail pages */
.content-col {
  min-width: 0;
}

.sidebar-col {
  min-width: 0;
}

.sidebar-col > .glass {
  width: 100%;
}

/* Common interactive wrappers */
.hover-scale {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-scale:hover {
  transform: translateY(-2px);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.06);
}

.badge-primary {
  background: rgba(99, 102, 241, 0.16);
  color: var(--accent);
  border-color: rgba(99, 102, 241, 0.25);
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Spec rows used by person view sidebar */
.widget-title {
  width: 100%;
  margin-bottom: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--glass-border);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-color);
}

.spec-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.spec-val {
  color: var(--text-color);
  font-size: 0.92rem;
  line-height: 1.45;
  word-break: break-word;
  text-align: right;
}

/* Dynamic form sections used on create/edit pages */
.dynamic-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.add-btn-small {
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-btn-small:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.55);
  transform: translateY(-1px);
}

.dynamic-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem;
  margin-bottom: 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
}

.remove-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.remove-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
}

.rel-search-input,
.credit-role-input {
  width: 100%;
}

.rel-hidden-id {
  display: none;
}

/* Person create/edit: category multi-select checkboxes */
.category-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.category-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 38px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-color);
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.category-check:hover {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.09);
}

.category-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  margin: 0;
  flex: 0 0 auto;
}

.category-check:has(input[type="checkbox"]:checked) {
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(99, 102, 241, 0.16);
}

/* Person create/edit: upload field glass placeholder */
.upload-placeholder {
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.upload-placeholder .form-control[type="file"] {
  border-style: dashed;
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(255, 255, 255, 0.03);
}

.upload-placeholder .form-control[type="file"]:focus {
  border-color: var(--accent);
}

#username-status a {
  font-size: 0.82rem;
}

/* Shared content blocks */
.article-body {
  color: var(--text-color);
  line-height: 1.75;
  font-size: 1rem;
}

/* Error page */
.error-container {
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.error-card {
  width: 100%;
  max-width: 700px;
  text-align: center;
  padding: 2.5rem 2rem;
}

.error-code {
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 1;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.error-msg {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

/* Auth helpers */
.feature-col {
  min-width: 0;
}

.toggle-link a {
  text-decoration: none;
}

.sidebar-col a.text-decoration-none,
.sidebar-col a.text-decoration-none:visited,
.sidebar-col a.hover-scale,
.sidebar-col a.hover-scale:visited {
  color: var(--text-color);
}

[data-theme="dark"] .spec-row {
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .spec-label {
  color: #b7c1d4;
}

[data-theme="dark"] .spec-val,
[data-theme="dark"] .widget-title {
  color: #e7ecf7;
}

[data-theme="dark"] .social-badge {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
  color: #e7ecf7;
}

[data-theme="dark"] .social-badge img {
  filter: brightness(0) invert(0.9);
  opacity: 0.92;
}

[data-theme="dark"] .sidebar-col .text-accent {
  color: #9db2ff !important;
}

[data-theme="dark"] .sidebar-col > .glass > .d-flex.flex-wrap.gap-2 {
  flex-wrap: nowrap !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0.1rem !important;
}

[data-theme="dark"] .upload-placeholder {
  border-color: rgba(148, 163, 184, 0.22);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.64));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .category-check {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.5);
}

[data-theme="dark"] .category-check:hover,
[data-theme="dark"] .category-check:has(input[type="checkbox"]:checked) {
  border-color: rgba(129, 140, 248, 0.6);
  background: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .sidebar-col .social-badge img,
[data-theme="dark"] .btn-icon img {
  filter: brightness(0) invert(1) saturate(0);
  opacity: 0.95;
}

/* Cleanup page cards */
.stat-card {
  padding: 1.5rem;
  border-radius: 12px;
  background: var(--bg-surface, var(--glass-bg));
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.orphan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.orphan-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface, var(--glass-bg));
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.orphan-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.orphan-card input[type="checkbox"] {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
}

.orphan-card:has(input[type="checkbox"]:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.orphan-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.orphan-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.orphan-details {
  padding: 0.75rem;
  font-size: 0.8rem;
  border-top: 1px solid var(--glass-border);
}

.orphan-filename {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  margin-bottom: 0.25rem;
  direction: rtl;
  text-align: left;
}

/* =========================================
   6. LAYOUT
   ========================================= */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  margin-left: calc(var(--sidebar-width) + 3rem);
  flex: 1;
  padding: 1.5rem 1.5rem 1.5rem 0;
  width: calc(100% - var(--sidebar-width) - 3rem);
}


/* =========================================
   7. SIDEBAR MODULE
   ========================================= */
.sidebar {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  bottom: 1.5rem;
  width: var(--sidebar-width);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 100;
}

/* --- Sidebar Logo --- */
.sidebar .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2rem;
  text-decoration: none;
}

.sidebar .logo img {
  height: 40px;
  width: 40px;
  object-fit: cover;
  border-radius: 12px;
}

.sidebar .logo span {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -2px;
  line-height: 1;
}

/* --- Sidebar Navigation --- */
.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.sidebar-links a {
  text-decoration: none;
  color: var(--text-color);
  padding: 0.20rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.sidebar-links a:hover,
.sidebar-links a.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--accent);
}

/* --- Sidebar Footer & Profile --- */
.sidebar-footer {
  border-top: 1px solid var(--glass-border);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
}

/* Specific adjustment for the theme toggle icon */
.icon-sm {
    width: 18px;
    height: 18px;
}

.nav-section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin: 1rem 0 0.5rem 1rem;
    font-weight: 600;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

/* --- Theme Toggle --- */
.theme-toggle {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.6rem;
  border-radius: 8px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--glass-border);
}


/* =========================================
   8. MOBILE COMPONENTS (Buttons/Overlay)
   ========================================= */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1001;
  background: var(--glass-bg);
  color: var(--text-color);
  border: none;
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}


/* =========================================
   9. RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 768px) {
  
  /* Show Mobile Toggle */
  .mobile-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* Reset Sidebar Position for Mobile */
  .sidebar {
    top: 6px;
    left: 6px;
    bottom: 6px;
    margin: 0;
    border-radius: 16px;
    width: 250px;
    transform: translateX(-110%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: auto;
  }
  
  /* Sidebar Open State */
  .sidebar.active {
    transform: translateX(0);
  }

  /* Adjust Logo for Mobile Sidebar */
  .sidebar .logo {
    justify-content: center;
  }

  .sidebar .logo img {
    height: 32px;
    width: 32px;
  }

  .sidebar .logo span {
    font-size: 1.3rem;
  }

  /* Adjust Main Content to full width */
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 4.5rem 1rem 1rem 1rem;
  }
}

/* =========================================
   10. FORM & INPUT STYLES (Glassmorphism)
   ========================================= */

/* --- Layout Grid --- */
.page-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .page-grid {
        grid-template-columns: 2fr 1fr; /* 2/3 Content, 1/3 Sidebar */
    }
}

/* --- Form Groups & Labels --- */
.form-group {
    margin-bottom: .5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-color);
}

/* --- The Input Control --- */
.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03); /* Very subtle fill */
    border: 1px solid rgb(198 198 198 / 33%);
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    transition: all 0.2s ease;
}

/* Focus State - Glow */
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); /* Accent Glow */
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.form-control option {
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* --- Input override for center alignment in OTP --- */
.form-control.text-center {
    text-align: center;
}

/* --- Inputs with Icons --- */
.input-group {
    position: relative;
}

.input-group .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--text-muted);
    pointer-events: none; /* Click passes through to input */
    transition: color 0.2s;
}

.input-group .form-control {
    padding-left: 44px; /* Make room for the icon */
}

.input-group:focus-within .input-icon {
    color: var(--accent);
}

/* --- Buttons --- */
.btn {
    cursor: pointer;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    font-family: inherit;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none; 
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.82rem;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    border-color: transparent;
    padding: 0.5rem 1.5rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn.glass {
    background: var(--glass-bg);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
}

.btn.glass:hover {
    border-color: var(--accent);
    color: var(--text-color);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.btn-danger-glass {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 0.55rem 1rem;
}

.btn-danger-glass:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.55);
}
.btn-icon {
    width: 40px;
    height: 40px;
    color: var(--text-color);
    background: var(--bg-color);
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon img {
    width: 20px;
    height: 20px;
    display: block;
}

[data-theme="dark"] .btn-icon img {
    filter: brightness(0) invert(1);
}

.btn-icon:hover {
    background: var(--glass-bg);
    box-shadow: var(--glass-shadow);
    transform: translateY(-2px);
}
/* --- Alerts --- */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

/* --- Header Specific --- */
.page-header {
    position: relative; 
    overflow: hidden; 
    padding: 4rem 2rem; 
    margin-bottom: 2rem;
}

.header-bg-icon {
    position: absolute; 
    right: -20px; 
    top: -20px; 
    font-size: 15rem; 
    opacity: 0.03; 
    transform: rotate(15deg);
    pointer-events: none;
}

/* =========================================
   11. AUTHENTICATION PAGE STYLES
   ========================================= */

/* --- Layout --- */
.auth-wrapper {
    min-height: calc(100vh - 160px); /* Centers vertically within main area */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.auth-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    width: 100%;
    max-width: 1000px;
    align-items: center;
}

@media (min-width: 992px) {
    .auth-grid {
        grid-template-columns: 1.2fr 1fr; /* Text wider than form */
        gap: 5rem;
    }
}

/* --- Left Column: Features --- */
.feature-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.feature-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.feature-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --- Right Column: Form Box --- */
.auth-box {
    padding: 2.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

/* --- Divider (OR line) --- */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--glass-border);
}

.auth-divider::before { margin-right: 1rem; }
.auth-divider::after { margin-left: 1rem; }

/* --- Google Button --- */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

[data-theme="dark"] .btn-google {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-google:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* =========================================
   12. TOOL GRID & CARDS
   ========================================= */

/* --- Advanced Search Bar --- */
.filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 1rem;
    align-items: end;
}

/* Elements that should span full width on Mobile for better UX */
.filter-span-mobile {
    grid-column: 1 / -1;
}

/* Desktop: Switch to 4 Equal Columns */
@media (min-width: 992px) {
    .filter-form {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Reset elements to take just 1 column on desktop */
    .filter-span-mobile {
        grid-column: span 1;
    }
}

/* Checkbox Groups Styling */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 46px; /* Match height of inputs */
    padding: 0 1rem;
    background: rgba(255, 255, 255, 0.05); /* Light glass effect */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem; /* Match form-control radius */
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    font-size: 0.95rem;
    user-select: none;
}

.checkbox-group input[type="checkbox"] {
    width: 1.2em;
    height: 1.2em;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* --- Card Item --- */
.card-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    position: relative;
    color: var(--text-color);
}

.card-item:visited {
    color: var(--text-color);
}

.card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--accent);
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    transition: all 0.2s;
}

.page-link:hover,
.page-link.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* =========================================
   17. SETTINGS PAGE STYLES
   ========================================= */

/* --- Avatar Upload --- */
.avatar-upload-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.avatar-preview {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--glass-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.avatar-edit-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid var(--glass-bg);
    transition: transform 0.2s;
}

.avatar-edit-btn:hover {
    transform: scale(1.1);
}

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--glass-border);
    background: var(--bg-color);
    padding: 3rem 0;
    position: relative;
    z-index: 10;
    border-radius: 15px; /* Rounds the top corners */
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.footer-brand {
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
/* Card Hover Animation */
.card-img-hover {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-item:hover .card-img-hover {
    transform: scale(1.05);
}

/* Section Title */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

/* Responsive Grid for Cards */
.responsive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Credits Grid */
.credits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
}

/* Mobile Styles */
.card-title-text {
    color: var(--text-color);
    line-height: 1.35;
}

@media (max-width: 576px) {
    .responsive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .credits-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .card-title-text {
        font-size: 0.95rem !important;
    }

    .credit-title-text {
        font-size: 0.85rem !important;
        color: var(--text-muted) !important;
    }

    .card-item > div:last-child {
        padding: 0.75rem 0.5rem !important;
    }
}

/* Autocomplete Dropdown */
.autocomplete-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-color, #ffffff);
    border: 1px solid var(--glass-border, #ccc);
    border-radius: 8px;
    z-index: 9999;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: 4px;
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--glass-border, #eee);
    font-size: 0.9rem;
    color: var(--text-color, #333);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--accent);
}

/* Utility */
.w-30 {
    width: 30%;
}

/* Footer Hover */
.hover-accent {
    transition: color 0.2s;
}
.hover-accent:hover {
    color: var(--accent) !important;
}

/* Share menu */
.share-menu-wrapper {
    position: relative;
}

.share-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    box-shadow: var(--glass-shadow);
    padding: 8px;
    z-index: 50;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.share-menu-up {
    top: auto;
    bottom: calc(100% + 8px);
}

@media (max-width: 576px) {
    .share-menu {
        position: fixed;
        left: 12px;
        right: 12px;
        top: auto !important;
        bottom: 72px !important;
        transform: none;
        width: auto;
        min-width: 0;
        max-height: 60vh;
        overflow-y: auto;
        z-index: 1200;
    }
}

.share-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    color: var(--text-color);
    text-decoration: none;
    font: inherit;
    font-size: 0.9rem;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
}

.share-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.share-item i {
    color: inherit;
}

[data-theme="dark"] .share-item img {
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

[data-theme="dark"] .share-item i {
    color: var(--text-color);
    opacity: 0.95;
}

.share-feedback {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.12);
}

/* Keyboard accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* View Transitions */
::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

::view-transition-old(root) {
    z-index: 1;
}

::view-transition-new(root) {
    z-index: 2147483646;
}

[data-theme="dark"]::view-transition-old(root) {
    z-index: 2147483646;
}

[data-theme="dark"]::view-transition-new(root) {
    z-index: 1;
}

    /* Strict 6-column grid for Homepage */
    .home-grid {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 1.5rem;
    }
    @media (max-width: 1200px) { .home-grid { grid-template-columns: repeat(4, 1fr); } }
    @media (max-width: 992px) { .home-grid { grid-template-columns: repeat(3, 1fr); } }
    @media (max-width: 576px) { .home-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; } }

    /* Custom Hero Search Styling */
    .hero-search-input {
        border-radius: 50px 0 0 50px !important;
        padding-left: 50px !important;
        height: 60px !important;
        font-size: 1.1rem !important;
        background: var(--glass-bg) !important;
        backdrop-filter: blur(20px);
    }
    .hero-search-btn {
        border-radius: 0 50px 50px 0 !important;
        height: 60px !important;
        padding: 0 2.5rem !important;
        font-size: 1.1rem !important;
    }
