/* --- 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 --- */
.pattern-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; z-index: 0;
    background-image: radial-gradient(circle, #94a3b8 1.2px, transparent 1.2px);
    background-size: 32px 32px;
    opacity: 0.5; 
}
.dark .pattern-grid {
    background-image: radial-gradient(circle, #64748b 1.2px, transparent 1.2px);
    opacity: 0.3;
}

/* --- CONTENT LAYERING --- */
#app-layout, #login-ui, #logout-ui, .modal-enter { position: relative; z-index: 10; }

/* --- STATUS ROWS (COLORS) --- */
/* Implemented: Soft Emerald (Green) */
tr.status-implemented { background-color: rgba(16, 185, 129, 0.134) !important; }
.dark tr.status-implemented { background-color: rgba(16, 185, 129, 0.11) !important; }
tr.status-implemented td:first-child { box-shadow: inset 3px 0 0 #10b981; }

/* Completed: Soft Blue */
tr.status-completed { background-color: rgba(37, 100, 235, 0.12) !important; }
.dark tr.status-completed { background-color: rgba(37, 100, 235, 0.113) !important; }
tr.status-completed td:first-child { box-shadow: inset 3px 0 0 #3b82f6; }

/* 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: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.dark .user-implemented { background: rgba(22, 163, 74, 0.2); color: #4ade80; border-color: rgba(22, 163, 74, 0.4); }
.user-completed { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.dark .user-completed { background: rgba(37, 99, 235, 0.2); color: #60a5fa; border-color: rgba(37, 99, 235, 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); } }

/* Hide native password reveal button in Edge/Chromium */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

/* Light mode autofill (Matches Tailwind slate-50) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #f8fafc inset !important;
    -webkit-text-fill-color: #1e293b !important; /* slate-800 text */
    caret-color: #1e293b !important;
    transition: background-color 5000s ease-in-out 0s;
}

input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px #f8fafc inset, 0 0 0 2px #3b82f6 !important;
    -webkit-text-fill-color: #1e293b !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Dark mode autofill (Matches Tailwind slate-900) */
.dark input:-webkit-autofill,
.dark input:-webkit-autofill:hover,
.dark input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #0f172a inset !important;
    -webkit-text-fill-color: #f8fafc !important; /* white text */
    caret-color: #f8fafc !important;
    transition: background-color 5000s ease-in-out 0s;
}

.dark input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px #0f172a inset, 0 0 0 2px #60a5fa !important;
    -webkit-text-fill-color: #f8fafc !important;
    caret-color: #f8fafc !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Custom rule to adjust badge sizing exclusively inside the XML review modal */
#xml-match-modal .w-24 span {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.hide-arrows::-webkit-inner-spin-button, .hide-arrows::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
