/* Jeevan Overseas India Custom Stylesheet (Premium SaaS Theme) */

:root {
    --primary-color: #6366f1; /* Bright Indigo */
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.08);
    --sidebar-bg: #0f172a; /* Dark Slate 900 */
    --sidebar-color: #94a3b8; /* Slate 400 */
    --sidebar-hover: rgba(255, 255, 255, 0.04);
    --sidebar-active-bg: rgba(99, 102, 241, 0.12);
    --sidebar-active-color: #cbd5e1;
    --sidebar-active-border: #6366f1;
    --body-bg: #f8fafc; /* Slate 50 Workspace background */
    --text-main: #0f172a; /* Slate 900 */
    --text-muted: #64748b; /* Slate 500 */
    --border-color: #f1f5f9; /* Slate 100 */
    --border-input: #cbd5e1; /* Slate 300 */
    --card-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.015), 0 4px 6px -4px rgba(15, 23, 42, 0.015);
    --card-border-radius: 16px;
    
    --success-bg: #dcfce7;
    --success-text: #15803d;
    --warning-bg: #fef9c3;
    --warning-text: #a16207;
    --danger-bg: #fee2e2;
    --danger-text: #b91c1c;
    --info-bg: #e0f2fe;
    --info-text: #0369a1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Global resets */
body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--body-bg);
    margin: 0;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.01em;
}

/* Main Layout Grid */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-color);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    padding: 2rem 1.25rem;
    box-shadow: 4px 0 24px 0 rgba(15, 23, 42, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 2rem;
}

.brand-title {
    color: #ffffff !important;
    font-weight: 800;
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    font-size: 0.7rem;
    color: #64748b !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-top: 0.35rem;
    font-weight: 600;
}

.sidebar-menu {
    gap: 0.35rem;
    display: flex;
    flex-direction: column;
}

.sidebar-menu .nav-link {
    color: var(--sidebar-color);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    text-decoration: none;
}

.sidebar-menu .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    margin-right: 0.75rem;
    transition: transform 0.2s ease;
}

.sidebar-menu .nav-link:hover {
    background-color: var(--sidebar-hover);
    color: #ffffff !important;
}

.sidebar-menu .nav-link:hover i {
    transform: translateX(2px);
}

.sidebar-menu .nav-link.active {
    background-color: var(--sidebar-active-bg) !important;
    color: #ffffff !important;
    font-weight: 600;
    border-left: 4px solid var(--sidebar-active-border);
    border-radius: 4px 10px 10px 4px;
    padding-left: calc(1rem - 4px);
}

.sidebar-profile-card {
    background-color: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 1rem;
    border-radius: 12px;
    margin-top: auto;
}

.sidebar-profile-card .border-top {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.9rem;
    background-color: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-info {
    margin-left: 0.75rem;
}

.profile-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #ffffff !important;
    line-height: 1.2;
}

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

/* Main Panel Layout */
.main-content {
    margin-left: 260px;
    flex-grow: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Navbar */
.top-navbar {
    height: 70px;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

.search-bar {
    width: 320px;
    position: relative;
}

.search-bar input {
    padding-left: 2.25rem !important;
    background-color: #f1f5f9 !important;
    border: none !important;
    font-size: 0.875rem;
}

.search-bar i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.live-status-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 30px;
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #dcfce7;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #22c55e;
    animation: blinker 1.5s linear infinite;
}

@keyframes blinker {
    50% { opacity: 0; }
}

/* Content Area */
.content-workspace {
    flex-grow: 1;
    background-color: var(--body-bg);
    padding: 2rem;
}

/* Cards & UI Panels */
.erp-card {
    background-color: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--card-border-radius);
    padding: 1.5rem;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.01), 0 2px 8px -1px rgba(15, 23, 42, 0.01);
    margin-bottom: 1.5rem;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.erp-card:hover {
    transform: translateY(-4px) scale(1.005);
    box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.05), 0 8px 10px -6px rgba(99, 102, 241, 0.03);
}

.card-stat-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0.25rem 0;
    color: var(--text-main);
    letter-spacing: -0.03em;
}

.card-stat-badge {
    font-size: 0.725rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
}

.card-stat-progress {
    height: 5px;
    border-radius: 3px;
    margin-top: 1.25rem;
    background-color: #f1f5f9;
}

/* Alert Styling */
.alert-card-critical {
    border-left: 4px solid #ef4444;
    background-color: #fef2f2;
}

.alert-card-normal {
    border-left: 4px solid #6366f1;
    background-color: #f5f3ff;
}

/* Factory Panel Column */
.factory-intel-header {
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.15rem;
    letter-spacing: -0.02em;
}

.factory-intel-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Form Styles */
.form-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: #475569;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid var(--border-input);
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    color: var(--text-main);
    background-color: #ffffff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15) !important;
}

.form-control-readonly {
    background-color: #f8fafc !important;
    border-color: var(--border-color) !important;
    font-weight: 600;
    color: #475569;
}

.calculated-total-display {
    background-color: #f5f3ff !important;
    border: 1px solid #ddd6fe !important;
    color: #4f46e5 !important;
    font-weight: 700 !important;
}

/* Custom Buttons Styling */
.btn {
    border-radius: 10px;
    padding: 0.55rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-outline-danger {
    border-color: #fee2e2;
    background-color: #fffafb;
    color: #ef4444;
}

.btn-outline-danger:hover {
    background-color: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

/* ERP Table Custom Styling */
.table-responsive {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.erp-table {
    margin-bottom: 0;
}

.erp-table thead th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.725rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

.erp-table tbody td {
    padding: 1.1rem 1.25rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    color: #374151;
}

.erp-table tbody tr {
    transition: background-color 0.15s ease;
}

.erp-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Custom Status Badges */
.badge {
    padding: 0.35rem 0.65rem;
    font-weight: 600;
    font-size: 0.725rem;
    border-radius: 20px;
    letter-spacing: 0.01em;
}

.badge-status-completed, .bg-success {
    background-color: var(--success-bg) !important;
    color: var(--success-text) !important;
}

.badge-status-pending, .bg-warning {
    background-color: var(--warning-bg) !important;
    color: var(--warning-text) !important;
}

.badge-status-processing, .bg-secondary {
    background-color: #f3f4f6 !important;
    color: #4b5563 !important;
}

.badge-status-shipped, .bg-info {
    background-color: var(--info-bg) !important;
    color: var(--info-text) !important;
}

.badge-status-cancelled, .bg-danger {
    background-color: var(--danger-bg) !important;
    color: var(--danger-text) !important;
}

/* Login Page Styling - Modernized Light/Indigo Glassmorphism */
.login-body {
    background: radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.05) 0%, rgba(243, 244, 246, 1) 100%);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    width: 440px;
    padding: 3rem 2.5rem;
    box-shadow: 0 15px 35px 0 rgba(0, 0, 0, 0.05), 0 5px 15px 0 rgba(0, 0, 0, 0.02);
}

.login-card .form-control {
    background: #ffffff;
    border: 1px solid var(--border-input);
    color: var(--text-main);
    transition: all 0.25s ease;
}

.login-card .form-control:focus {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    color: var(--text-main);
}

.login-card .form-label {
    color: #374151;
}

.login-card .input-group-text {
    border: 1px solid var(--border-input);
    background-color: #f9fafb !important;
    color: var(--text-muted) !important;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .sidebar {
        left: -260px;
        width: 260px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050; /* Set above everything else */
    }
    
    .sidebar.active {
        left: 0;
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.15);
    }
    
    .sidebar-brand {
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .sidebar-brand .brand-title, .sidebar-brand .brand-subtitle, .sidebar-menu span, .sidebar-profile-card {
        display: block !important;
    }
    
    .sidebar-menu .nav-link {
        text-align: left;
        padding: 0.75rem 1rem;
        justify-content: flex-start;
    }
    
    .sidebar-menu .nav-link i {
        margin-right: 0.75rem !important;
        font-size: 1.1rem;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }
    
    .top-navbar {
        padding: 0 1rem;
    }
}

/* Sidebar Backdrop / Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, 0.4); /* Dark muted indigo-black */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040; /* Just below active sidebar */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Bottom Navigation Styles */
.mobile-bottom-nav {
    border-top: 1px solid rgba(243, 244, 246, 0.8) !important;
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.04) !important;
    height: 68px !important;
    padding: 6px 12px !important;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1010;
    display: flex;
    justify-content: space-around;
}

.mobile-nav-link {
    color: var(--text-muted);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    text-decoration: none !important;
}

/* Icon Container Capsule */
.mobile-icon-wrapper {
    width: 52px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    margin-bottom: 3px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: #9ca3af; /* Default gray for inactive icons */
}

.mobile-icon-wrapper i {
    font-size: 1.15rem;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active tab style */
.mobile-nav-link.active .mobile-icon-wrapper {
    background-color: rgba(79, 70, 229, 0.1); /* Light indigo capsule bg */
    color: var(--primary-color) !important;
}

.mobile-nav-link.active .mobile-icon-wrapper i {
    transform: scale(1.05);
    color: var(--primary-color) !important;
}

.mobile-nav-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #6b7280;
    transition: color 0.25s ease;
}

.mobile-nav-link.active .mobile-nav-label {
    color: var(--primary-color) !important;
    font-weight: 700;
}

@media (max-width: 767.98px) {
    body {
        padding-bottom: 78px; /* Space for bottom nav bar */
    }
    .content-workspace {
        padding: 1.25rem 0.75rem;
    }
    .search-bar {
        display: none !important;
    }
    .card-stat-value {
        font-size: 1.6rem;
    }
    .card-stat-title {
        font-size: 0.65rem;
        letter-spacing: 0.02em;
    }
    .erp-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
}

/* Centralized Premium Styling for DataTable Buttons */
.dt-buttons {
    margin-bottom: 1.25rem !important;
    display: inline-flex !important;
    gap: 0.5rem !important;
}

.dt-buttons .btn {
    border-radius: 8px !important;
    padding: 0.45rem 1rem !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}

.dt-buttons .btn-outline-secondary {
    color: var(--text-muted) !important;
    background-color: #f9fafb !important;
    border: 1px solid var(--border-color) !important;
}
.dt-buttons .btn-outline-secondary:hover {
    background-color: #e5e7eb !important;
    color: var(--text-main) !important;
    border-color: #d1d5db !important;
}

.dt-buttons .btn-outline-success {
    color: #16a34a !important;
    border: 1px solid #bdf0d4 !important;
    background-color: #f0fdf4 !important;
}
.dt-buttons .btn-outline-success:hover {
    background-color: #16a34a !important;
    color: #ffffff !important;
    border-color: #16a34a !important;
}

.dt-buttons .btn-outline-danger {
    color: #dc2626 !important;
    border: 1px solid #fecaca !important;
    background-color: #fef2f2 !important;
}
.dt-buttons .btn-outline-danger:hover {
    background-color: #dc2626 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
}

