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

:root {
    --erp-primary: #4F46E5; 
    --erp-secondary: #06B6D4; 
    --erp-dark: #0F172A; 
    --erp-light: #F1F5F9; 
    --erp-success: #10B981;
    --erp-warning: #F59E0B;
    --erp-danger: #EF4444;
}

[data-theme="dark"] {
    --erp-light: #0F172A;
    --erp-dark: #1E293B;
}

[data-theme="dark"] body,
[data-theme="dark"] .admin-wrapper {
    color: #E2E8F0;
    background-color: #0F172A;
}

[data-theme="dark"] .erp-card, 
[data-theme="dark"] .admin-topbar,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .login-card {
    background-color: #1E293B !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #E2E8F0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .table tbody tr,
[data-theme="dark"] table.dataTable tbody tr,
[data-theme="dark"] .table thead th,
[data-theme="dark"] table.dataTable thead th {
    background-color: #1E293B !important;
    color: #E2E8F0 !important;
    border-color: #334155;
}

[data-theme="dark"] .table tbody td,
[data-theme="dark"] table.dataTable tbody td {
    background-color: transparent !important; 
    box-shadow: none !important;
    color: #E2E8F0 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .table-hover tbody tr:hover td,
[data-theme="dark"] table.dataTable.table-hover tbody tr:hover td {
    background-color: #283548 !important; 
}

[data-theme="dark"] .table-light {
    background-color: #0F172A !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .input-group-text,
[data-theme="dark"] .dataTables_wrapper .dataTables_length select,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input {
    background-color: #0F172A;
    border-color: #334155;
    color: #E2E8F0;
}

[data-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #E2E8F0 !important;
}

[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #4F46E5 !important;
    color: white !important;
    border-color: #4F46E5 !important;
}

[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input::placeholder {
    color: #64748B;
}

[data-theme="dark"] .text-dark {
    color: #E2E8F0 !important;
}

[data-theme="dark"] .text-secondary {
    color: #94A3B8 !important;
}

[data-theme="dark"] .text-muted {
    color: #64748B !important;
}

[data-theme="dark"] .btn-light {
    background-color: #334155;
    border-color: #475569 !important;
    color: #E2E8F0 !important;
}

[data-theme="dark"] .bg-light {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: #334155;
}

[data-theme="dark"] .modal-footer.bg-light {
    background-color: #0F172A !important;
}
[data-theme="dark"] .bg-white {
    background-color: #1E293B !important;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #F4F7FE;
    color: #334155;
    overflow-x: hidden;
}


#loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--erp-dark);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}
.spinner {
    width: 50px; height: 50px;
    border: 5px solid rgba(255,255,255,0.1);
    border-top-color: var(--erp-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }


.navbar-erp {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.navbar-brand span {
    display: inline-block;
    font-weight: bold;
    background: linear-gradient(90deg, #4F46E5, #06B6D4);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}


.hero-erp {
    background: linear-gradient(135deg, var(--erp-dark) 0%, #1E293B 100%);
    color: white;
    padding-top: 120px;
    padding-bottom: 80px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}
.floating-element {
    animation: float 4s ease-in-out infinite;
}
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}


.floating-whatsapp {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: transform 0.3s;
}
.floating-whatsapp:hover {
    transform: scale(1.1);
    color: white;
}


.admin-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: #F4F7FE;
}
.sidebar {
    width: 260px;
    background: #111827;
    border-right: none;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}
.sidebar-brand {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}
.sidebar-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.25), rgba(6, 182, 212, 0.25));
    border: 1px solid rgba(6, 182, 212, 0.35);
    color: #06B6D4;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sidebar-brand:hover .sidebar-brand-icon {
    transform: scale(1.1) rotate(-6deg);
}

.sidebar-menu {
    padding: 16px 0 35px 0;
}

/* Sidebar Section Headings */
.sidebar-heading {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: #64748B;
    padding: 16px 20px 7px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    user-select: none;
}
.sidebar-heading i {
    font-size: 0.75rem;
    color: #06B6D4;
    transition: transform 0.3s ease;
}
.sidebar-heading:hover i {
    transform: rotate(15deg) scale(1.15);
}
.sidebar-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.01) 100%);
}

/* Sidebar Menu Links */
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 11px 16px;
    color: #94A3B8;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 500;
    font-size: 0.92rem;
    margin: 3px 12px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3.5px;
    height: 60%;
    background: #06B6D4;
    border-radius: 0 4px 4px 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-link i.menu-icon,
.sidebar-link > i:first-child {
    width: 28px;
    font-size: 1.05rem;
    color: #06B6D4;
    transition: transform 0.25s ease, color 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-link .menu-arrow {
    margin-left: auto;
    font-size: 0.72rem;
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    color: #64748B;
}

.sidebar-link:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
}

.sidebar-link:hover::before {
    transform: translateY(-50%) scaleY(1);
}

.sidebar-link:hover i.menu-icon,
.sidebar-link:hover > i:first-child {
    transform: scale(1.18) rotate(4deg);
    color: #38BDF8;
}

.sidebar-link:hover .menu-arrow {
    opacity: 0.8;
    transform: translateX(0);
    color: #94A3B8;
}

.sidebar-link.active {
    background: linear-gradient(135deg, #4F46E5 0%, #06B6D4 100%);
    color: #FFFFFF !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.35);
    transform: translateX(4px);
}

.sidebar-link.active::before {
    display: none;
}

.sidebar-link.active i.menu-icon,
.sidebar-link.active > i:first-child {
    color: #FFFFFF !important;
    transform: scale(1.12);
}

.sidebar-link.active .menu-arrow {
    opacity: 1;
    transform: translateX(0);
    color: #FFFFFF;
}

/* Custom Sleek Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: #4F46E5;
}


.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    width: calc(100% - 260px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.erp-card {
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #E5E7EB;
    padding: 25px;
    margin-bottom: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.erp-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    animation: jelly 0.6s ease;
}


.table {
    border-collapse: separate;
    border-spacing: 0 8px;
}
.table thead th {
    background-color: #F8FAFC !important;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #E2E8F0;
    padding: 15px;
}
.table tbody tr {
    background-color: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
    transition: all 0.2s;
}
.table tbody tr:hover {
    background-color: #F8FAFC;
}
.table tbody td {
    border: none;
    padding: 15px;
    vertical-align: middle;
}
.table tbody tr td:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.table tbody tr td:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }


.btn {
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 10px 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    animation: jelly 0.6s ease;
}
.btn:active {
    transform: translateY(1px);
}
.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: 8px;
}
.btn-primary { 
    background: linear-gradient(135deg, #4F46E5, #312E81); 
    color: white !important;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover { 
    background: linear-gradient(135deg, #4338CA, #1E1B4B); 
}
.btn-secondary {
    background: linear-gradient(135deg, #64748B, #334155);
    color: white !important;
}
.btn-success {
    background: linear-gradient(135deg, #10B981, #047857);
    color: white !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-danger {
    background: linear-gradient(135deg, #EF4444, #B91C1C);
    color: white !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.btn-info {
    background: linear-gradient(135deg, #06B6D4, #0369A1);
    color: white !important;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}
.btn-light {
    background: #FFFFFF;
    color: #334155 !important;
    border: 1px solid #E2E8F0 !important;
}
.btn-outline-primary, .btn-outline-danger, .btn-outline-success {
    background: transparent !important;
    border: 2px solid currentColor !important;
    box-shadow: none !important;
}
.btn-outline-primary { color: #4F46E5 !important; }
.btn-outline-primary:hover { background: #4F46E5 !important; color: white !important; box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3) !important; }
.btn-outline-danger { color: #EF4444 !important; }
.btn-outline-danger:hover { background: #EF4444 !important; color: white !important; box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3) !important; }
.btn-outline-success { color: #10B981 !important; }
.btn-outline-success:hover { background: #10B981 !important; color: white !important; box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3) !important; }

.badge { padding: 6px 12px; font-weight: 600; border-radius: 6px; letter-spacing: 0.5px; }


.admin-topbar {
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #E5E7EB;
    padding: 15px 25px;
    margin-bottom: 30px;
}

/* PDF Export Styles */
.pdf-export-mode {
    width: 794px !important;
    background: #ffffff !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}
.pdf-export-mode .receipt-body {
    padding: 2.5rem !important;
}
.pdf-export-mode .receipt-header-banner {
    padding: 2.5rem !important;
}
.pdf-export-mode .mb-5 {
    margin-bottom: 2rem !important;
}
.pdf-export-mode .mt-5 {
    margin-top: 2rem !important;
}
.pdf-export-mode .py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

@keyframes jelly {
    0% { transform: scale(1, 1); }
    30% { transform: scale(1.05, 0.95); }
    40% { transform: scale(0.95, 1.05); }
    50% { transform: scale(1.02, 0.98); }
    65% { transform: scale(0.98, 1.02); }
    75% { transform: scale(1.01, 0.99); }
    100% { transform: scale(1, 1); }
}

.sidebar-link:hover, .nav-link:hover, .dropdown-item:hover, .floating-whatsapp:hover {
    animation: jelly 0.6s ease;
}

/* ==========================================================================
   Rich Dashboard Animations & Visual Aesthetics
   ========================================================================== */
.stat-card-modern {
    background: #FFFFFF;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    padding: 22px 20px;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.stat-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--card-accent, #4F46E5), transparent);
    opacity: 0.9;
}

.stat-card-modern:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 30px -4px rgba(79, 70, 229, 0.12), 0 8px 16px -4px rgba(0, 0, 0, 0.04);
}

.stat-card-modern:hover .bounce-icon {
    animation: bounceIcon 0.8s ease infinite;
}

.stat-card-modern:hover .shake-icon {
    animation: shakeIcon 0.6s ease infinite;
}

.stat-card-modern:hover .pulse-icon {
    animation: pulseIcon 1s ease infinite;
}

.stat-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.stat-card-modern:hover .stat-icon-box {
    transform: scale(1.1) rotate(5deg);
}

@keyframes bounceIcon {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

@keyframes shakeIcon {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(12deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-12deg); }
    100% { transform: rotate(0deg); }
}

@keyframes pulseIcon {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.pulse-badge {
    animation: pulseBadgeAnim 2s infinite;
}

@keyframes pulseBadgeAnim {
    0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(79, 70, 229, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

.btn-hover-glow {
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-hover-glow:hover {
    transform: translateY(-3px) translateX(3px);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.25) !important;
}

[data-theme="dark"] .stat-card-modern {
    background: #1E293B !important;
    border-color: rgba(255, 255, 255, 0.08);
}

/* Ensure dropdown menus in tables are never clipped by table-responsive */
.table-responsive {
    overflow: visible !important;
    min-height: 240px;
}

@media (max-width: 991px) {
    .table-responsive {
        overflow-x: auto !important;
    }
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    z-index: 1065 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 0.5rem !important;
}

[data-theme="dark"] .dropdown-menu {
    background-color: #1E293B !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .dropdown-item {
    color: #E2E8F0 !important;
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.07) !important;
    color: #FFFFFF !important;
}

.dropdown-item {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.15s ease-in-out;
}

.dropdown-item:hover {
    background-color: #F1F5F9;
}

.table tbody tr:has(.dropdown-menu.show),
table.dataTable tbody tr:has(.dropdown-menu.show) {
    position: relative;
    z-index: 1050;
}
.dropdown.show,
.dropdown:has(.dropdown-menu.show) {
    position: relative;
    z-index: 1060;
}

/* ==========================================================================
   Responsive Layout & Sidebar Mobile Styles
   ========================================================================== */
.sidebar.collapsed {
    transform: translateX(-100%);
}

.main-content.expanded {
    margin-left: 0 !important;
    width: 100% !important;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1050;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
    }
    
    .sidebar.show {
        transform: translateX(0) !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 16px !important;
    }
    
    .admin-topbar {
        padding: 12px 16px !important;
        margin-bottom: 20px !important;
    }
    
    .stat-card-modern {
        padding: 16px !important;
    }
}

/* Quick Actions Sleek Card Items */
.quick-action-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    text-decoration: none;
    color: #1E293B;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.quick-action-item:hover {
    background: #FFFFFF;
    border-color: #06B6D4;
    transform: translateX(4px);
    box-shadow: 0 6px 20px -4px rgba(6, 182, 212, 0.15);
    color: #0F172A;
}

.quick-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-right: 12px;
    transition: transform 0.25s ease;
}

.quick-action-item:hover .quick-action-icon {
    transform: scale(1.1) rotate(4deg);
}

.quick-action-info {
    flex: 1;
    min-width: 0;
}

.quick-action-title {
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.2;
    color: #1E293B;
}

.quick-action-desc {
    font-size: 0.75rem;
    color: #64748B;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-action-arrow {
    font-size: 0.8rem;
    color: #94A3B8;
    transition: transform 0.25s ease, color 0.25s ease;
    margin-left: 8px;
}

.quick-action-item:hover .quick-action-arrow {
    transform: translateX(3px);
    color: #06B6D4;
}

[data-theme="dark"] .quick-action-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    color: #E2E8F0;
}

[data-theme="dark"] .quick-action-item:hover {
    background: #1E293B;
    border-color: #06B6D4;
}

[data-theme="dark"] .quick-action-title {
    color: #F8FAFC;
}

[data-theme="dark"] .quick-action-desc {
    color: #94A3B8;
}


