/* --- CORE --- */
html { scroll-behavior: smooth; transition: background-color 0.3s, color 0.3s; }

/* --- SCROLLBARS --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
.dark ::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.dark ::-webkit-scrollbar-thumb:hover { background: #475569; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* --- DOT GRID PATTERN (Subtler) --- */
.pattern-grid {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 0;
    /* Light Mode: Very subtle gray dots */
    background-image: radial-gradient(circle, #94a3b8 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.15; 
}
.dark .pattern-grid {
    /* Dark Mode: Subtle blue-gray dots */
    background-image: radial-gradient(circle, #475569 1px, transparent 1px);
    opacity: 0.15;
}

/* --- CONTENT LAYERING --- */
#app-layout, #login-ui, #logout-ui, .modal-enter { position: relative; z-index: 10; }

/* --- STATUS ROWS (IMPROVED COLORS) --- */
/* Implemented: Soft Blue */
tr.status-implemented { background-color: #eff6ff !important; } /* Blue-50 */
.dark tr.status-implemented { background-color: rgba(37, 99, 235, 0.1) !important; }
tr.status-implemented td:first-child { box-shadow: inset 3px 0 0 #3b82f6; }

/* Completed: Soft Green */
tr.status-completed { background-color: #f0fdf4 !important; opacity: 0.7; } /* Green-50 */
.dark tr.status-completed { background-color: rgba(34, 197, 94, 0.08) !important; }
tr.status-completed:hover { opacity: 1; }
tr.status-completed td:first-child { box-shadow: inset 3px 0 0 #22c55e; }

/* Pending: Default */
tr.status-pending td:first-child { box-shadow: inset 3px 0 0 transparent; }

/* --- LOADERS --- */
.loader { border: 3px solid #e2e8f0; border-top: 3px solid #3b82f6; border-radius: 50%; width: 24px; height: 24px; animation: spin 1s linear infinite; }
.dark .loader { border-color: #1e293b; border-top-color: #3b82f6; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- ICONS --- */
.icon-wrapper { position: relative; width: 40px; height: 40px; }
.app-icon { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; background: white; position: absolute; top: 0; left: 0; z-index: 10; }
.app-icon-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: bold; color: white; font-size: 1.1rem; position: absolute; top: 0; left: 0; z-index: 1; text-shadow: 0 1px 2px rgba(0,0,0,0.1); }
img.app-icon[src=""], img.app-icon:not([src]) { display: none; }
img.app-icon.error { display: none; }
img.app-icon.error + .app-icon-fallback { display: flex; }

/* --- NAVIGATION --- */
.nav-item.active { background-color: #eff6ff; color: #2563eb; border-right: 3px solid #2563eb; }
.dark .nav-item.active { background-color: rgba(59, 130, 246, 0.15); color: #60a5fa; border-right: 3px solid #60a5fa; }
.mobile-nav-item.active { color: #2563eb; }
.dark .mobile-nav-item.active { color: #60a5fa; }

.sidebar-text { transition: opacity 0.2s, width 0.2s; white-space: nowrap; overflow: hidden; }
.sidebar-collapsed .sidebar-text { opacity: 0; width: 0; }
.sidebar-collapsed .logo-text { display: none; }
.sidebar-collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar-collapsed .nav-item i { margin: 0; }

/* --- BADGES --- */
.user-badge { font-size: 10px; padding: 4px 8px; border-radius: 6px; text-transform: uppercase; font-weight: 700; border: 1px solid; display: inline-block; min-width: 60px; text-align: center; letter-spacing: 0.025em; }
.user-pending { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.dark .user-pending { background: #1e293b; color: #94a3b8; border-color: #334155; }
.user-implemented { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.dark .user-implemented { background: rgba(37, 99, 235, 0.2); color: #60a5fa; border-color: rgba(37, 99, 235, 0.4); }
.user-completed { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.dark .user-completed { background: rgba(22, 163, 74, 0.2); color: #4ade80; border-color: rgba(22, 163, 74, 0.4); }

/* --- MODALS --- */
.modal-enter { animation: fade-in 0.2s ease-out forwards; }
@keyframes fade-in { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
