/* CSS_FIX_DEPLOY_TEST_V2 */
/*
 * Modern ERP UI Redesign
 * Overrides for AdminKit / Bootstrap 5
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Bright Premium Palette */
    --primary-bg: #f5f7fa;
    --sidebar-bg: #1e293b; /* Space Grey */
    --accent-indigo: #4361ee;
    --accent-indigo-hover: #3a56d4;
    --accent-cyan: #0ea5e9;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.08);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --card-radius: 12px;
    --transition-smooth: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

body {
    background-color: var(--primary-bg);
    color: var(--text-main);
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
    letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 700;
    color: var(--text-main);
}

/* Sidebar Modernization */
.sidebar {
    background: var(--matte-black);
    border-right: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.sidebar-content {
    background: transparent;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 1.5rem 1.5rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar-brand img {
    max-height: 40px;
    width: auto;
    margin-right: 0.75rem;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3));
}

.sidebar-brand:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    max-height: 32px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.2));
}

.sidebar-userbox {
    padding: 1rem 1.5rem;
    margin: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-gradient);
    padding: 2px;
}

.sidebar-avatar img, .sidebar-avatar-initials {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e293b;
    color: white;
    font-weight: 600;
}

.sidebar-username {
    color: #f8fafc;
    font-size: 0.9rem;
    font-weight: 600;
}

.sidebar-designation {
    color: #94a3b8 !important;
    font-size: 0.75rem;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.75rem 1.5rem;
}

.nav-icon {
    color: #64748b !important;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-icon:hover {
    background: #f1f5f9;
    color: var(--primary-color) !important;
}

.indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border: 2px solid #fff;
    border-radius: 50%;
}

.navbar-nav .avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.dropdown-menu {
    border: 1px solid rgba(0,0,0,0.05) !important;
    box-shadow: var(--card-shadow) !important;
    border-radius: 12px !important;
    padding: 0.5rem !important;
}

.dropdown-item {
    border-radius: 8px !important;
    padding: 0.6rem 1rem !important;
    font-size: 0.9rem !important;
    color: #475569 !important;
}

.dropdown-item:hover {
    background: #f1f5f9 !important;
    color: var(--primary-color) !important;
}

.dropdown-menu-header {
    padding: 1rem !important;
    font-weight: 700 !important;
    font-family: 'Outfit', sans-serif !important;
    color: #1e293b !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

/* Card & Widget Modernization */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-indigo);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--glass-border);
    padding: 1.25rem var(--card-px);
}

.card-title {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.card-body {
    padding: var(--card-py) var(--card-px) !important;
}

/* Buttons */
.btn-primary {
    background: var(--accent-indigo);
    border: none;
    color: #fff !important;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.15);
}

.btn-primary:hover {
    background: var(--accent-indigo-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.25);
}

.btn-white {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: #fff;
    backdrop-filter: blur(5px);
}

.btn-white:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-gold);
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

/* Sidebar Brand Refinement */
.sidebar-brand {
    padding: 1.25rem 1.5rem !important;
}

.sidebar-logo {
    max-height: 24px;
    width: auto;
    object-fit: contain;
}

/* Navbar */
.navbar {
    background: var(--card-bg) !important;
    border-bottom: 1px solid var(--card-border) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02) !important;
}

/* Widgets - Stats */
.stat {
    background: #f1f5f9;
    padding: 0.75rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
    width: 40px;
    height: 40px;
}

.widget-hover {
    cursor: pointer;
    text-decoration: none !important;
}

.widget-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1) !important;
}

.widget-flat {
    position: relative;
    overflow: hidden;
}

.widget-flat::after {
    content: "";
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: var(--primary-gradient);
    opacity: 0.05;
    border-radius: 50%;
}

.glass-card {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Subtle Variants */
.bg-primary-subtle { background-color: rgba(99, 102, 241, 0.1) !important; color: #6366f1 !important; }
.bg-success-subtle { background-color: rgba(16, 185, 129, 0.1) !important; color: #10b981 !important; }
.bg-warning-subtle { background-color: rgba(245, 158, 11, 0.1) !important; color: #f59e0b !important; }
.bg-danger-subtle { background-color: rgba(239, 68, 68, 0.1) !important; color: #ef4444 !important; }
.bg-info-subtle { background-color: rgba(6, 182, 212, 0.1) !important; color: #06b6d4 !important; }

.badge-subtle {
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

/* Tables */
.table thead th {
    background: #f8fafc;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
    color: #64748b;
    font-weight: 700;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    color: #334155;
}

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

.content {
    animation: fadeIn 0.4s ease-out;
}

/* Login Page Specifics */
.auth-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    border-radius: 1.5rem !important;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
}

.form-control-lg {
    border-radius: 0.75rem !important;
    font-size: 1rem !important;
    padding: 0.75rem 1rem !important;
    border: 1px solid #e2e8f0 !important;
}

.sidebar-nav {
    padding: 0.75rem;
}

.sidebar-item {
    margin-bottom: 0.25rem;
}

.sidebar-link {
    background: transparent;
    border-left: 3px solid transparent;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.65rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 400;
    transition: var(--transition-smooth);
    border-radius: 10px;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--accent-gold) !important;
}

.sidebar-link i, .sidebar-link svg {
    color: var(--accent-indigo);
}

.sidebar-item.active .sidebar-link {
    background: rgba(67, 97, 238, 0.08) !important;
    color: var(--accent-indigo) !important;
    border-left: 4px solid var(--accent-indigo) !important;
}

.sidebar-item.active .sidebar-link,
.sidebar-item.active > .sidebar-link {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.1) 0%, transparent 100%);
    color: var(--accent-gold) !important;
    border-left-color: var(--accent-gold);
    font-weight: 600;
}

/* Glassmorphism for Navbar */
.navbar {
    background: rgba(13, 13, 13, 0.8) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

/* Stats Cards Enhancement */
.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
}

.stat-value {
    color: var(--accent-gold);
    font-weight: 800;
}

/* Global Form Controls - Improved Contrast */
.form-control, .form-select {
    background: #ffffff !important;
    border: 1px solid #ced4da !important;
    color: #1e293b !important; /* Dark Blue-Grey for high contrast */
    border-radius: 10px;
    padding: 0.6rem 1rem;
    transition: var(--transition-smooth);
}

.form-control:focus, .form-select:focus {
    background: #ffffff !important;
    border-color: var(--accent-gold) !important;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15) !important;
    color: #1e293b !important;
}

/* Max width for inputs to prevent stretching */
@media (min-width: 992px) {
    .container-fluid .card-body .form-control,
    .container-fluid .card-body .form-select {
        max-width: 100%; /* Default to full within grids */
    }
    
    .form-group-max {
        max-width: 600px;
    }
}
