:root {
    --primary-dark: #0f172a;
    --primary-blue: #1e40af;
    --accent-red: #f42a41;
    --accent-green: #006a4e;
    --accent-yellow: #d97706;
    --text-light: #f8fafc;
    --card-bg: #1e293b;
    --border-color: #334155;
    --bd-green: #006a4e;
    --bd-red: #f42a41;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--primary-dark);
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Visibility & Contrast Overrides */
.text-muted {
    color: #94a3b8 !important; /* Brighter muted color for dark background */
}

::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
}

h1, h2, h3, h4, h5, h6 {
    color: #f8fafc;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--primary-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Navbar */
.navbar {
    background-color: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-light) !important;
}

.nav-link {
    color: rgba(248, 250, 252, 0.8) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 0 0.5rem;
}

.nav-link:hover {
    color: var(--bd-red) !important;
}

.nav-link.active {
    color: var(--bd-green) !important;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-blue);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

/* Buttons */
.btn-primary {
    background-color: var(--bd-green);
    border-color: var(--bd-green);
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #00563f;
    border-color: #00563f;
    transform: scale(1.02);
}

.btn-danger {
    background-color: var(--bd-red);
    border-color: var(--bd-red);
}

/* Badges for Priority */
.badge-prio-high { background-color: var(--bd-red); color: white; }
.badge-prio-medium { background-color: var(--accent-yellow); color: white; }
.badge-prio-low { background-color: var(--accent-green); color: white; }

/* Badges for Status */
.status-pending { background-color: var(--bd-red); }
.status-underreview { background-color: var(--accent-yellow); }
.status-investigating { background-color: var(--primary-blue); }
.status-resolved { background-color: var(--accent-green); }

.badge {
    padding: 0.5em 0.8em;
    font-weight: 600;
    border-radius: 6px;
}

/* Forms */
.form-control, .form-select {
    background-color: #0f172a;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 8px;
    padding: 0.75rem;
}

.form-control:focus, .form-select:focus {
    background-color: #0f172a;
    border-color: var(--bd-green);
    box-shadow: 0 0 0 0.25rem rgba(0, 106, 78, 0.25);
    color: var(--text-light);
}

/* Toast Notification */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
}

.custom-toast {
    min-width: 250px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: var(--card-bg);
    border-left: 4px solid var(--primary-blue);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    margin-top: 1rem;
    display: none;
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Footer */
footer {
    background-color: #020617;
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: auto;
}

.footer-logo {
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: block;
}

/* Accessibility */
:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 4px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Micro-interactions */
.btn-animate-success {
    background-color: var(--bd-green) !important;
    transform: scale(1.05);
}

.status-pending {
    background-color: #334155;
    animation: pulse-soft 2s infinite;
}

@keyframes pulse-soft {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

/* Loading Skeletons */
.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    display: inline-block;
    height: 1em;
    width: 100%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .hero-title { font-size: 3rem; }
    .sidebar { position: fixed; left: -260px; z-index: 1050; height: 100vh; transition: 0.3s; }
    .sidebar.active { left: 0; }
    .main-content { padding: 1.5rem; margin-left: 0; }
}

@media (max-width: 768px) {
    .hero-title { font-size: 2.25rem; }
    .hero-subtitle { font-size: 1rem; }
    .hero-btns { flex-direction: column; }
    .hero-btns .btn { width: 100%; margin-bottom: 0.5rem; }
    
    .stat-card-admin { margin-bottom: 1rem; }
    
    .table-responsive-mobile { border: 0; }
    .table-responsive-mobile thead { display: none; }
    .table-responsive-mobile tr { display: block; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; margin-bottom: 1rem; }
    .table-responsive-mobile td { display: flex; justify-content: flex-end; align-items: center; border: 0 !important; width: 100%; padding: 0.5rem 0; font-size: 0.9rem; }
    .table-responsive-mobile td::before { content: attr(data-label); flex-grow: 1; margin-right: 0.5rem; color: #94a3b8; font-weight: 600; text-align: left; }
    
    /* Tap Targets */
    .btn, .form-control, .form-select {
        min-height: 44px;
    }
}

/* Empty States */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: #475569;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

/* Loader */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-left-color: var(--bd-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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