/* ================= CSS Custom Properties ================= */
:root {
    /* Primary Colors */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;

    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Accent Colors */
    --success: #10b981;
    --success-600: #059669;
    --warning: #f59e0b;
    --warning-600: #d97706;
    --error: #ef4444;
    --error-600: #dc2626;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= General Layout ================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
html,
body {
    height: 100%;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-style: normal;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.6;
    color: var(--gray-800);
}

/* ================= Typography Scale ================= */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-900);
}

h1 { font-size: 2.25rem; font-weight: 700; }
h2 { font-size: 1.875rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 500; }
h5 { font-size: 1.125rem; font-weight: 500; }
h6 { font-size: 1rem; font-weight: 500; }

p {
    margin-bottom: 1rem;
}

/* ================= Modern Card Design ================= */
.card-modern {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(59, 130, 246, 0.2);
}

.card-modern-header {
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.card-modern-body {
    padding: 1.5rem;
}

.card-modern-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
}

/* ================= Enhanced Button Styles ================= */
.btn-modern {
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.75rem 1.5rem;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-modern:hover::before {
    width: 300px;
    height: 300px;
}

.btn-modern:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-modern:active {
    transform: translateY(0);
}

/* Button variants */
.btn-primary-modern {
    background: var(--gradient-primary);
    color: white;
}

.btn-secondary-modern {
    background: var(--gradient-secondary);
    color: white;
}

.btn-success-modern {
    background: var(--gradient-success);
    color: white;
}

.btn-warning-modern {
    background: var(--gradient-warning);
    color: black;
}

/* ================= Form Enhancements ================= */
.form-control-modern {
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    background: white;
}

.form-control-modern:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-control-modern:hover {
    border-color: var(--gray-400);
}

.form-select-modern {
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    background: white;
    transition: all var(--transition-fast);
}

.form-select-modern:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* ================= Form Labels ================= */
.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

/* ================= Interactive Elements ================= */
.interactive-element {
    transition: all var(--transition-fast);
    cursor: pointer;
}

.interactive-element:hover {
    transform: translateY(-2px);
}

.clickable-row {
    transition: all var(--transition-fast);
}

.clickable-row:hover {
    background-color: var(--gray-50);
    transform: scale(1.01);
    box-shadow: var(--shadow-md);
}

/* ================= Enhanced Responsive Design ================= */

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Touch devices */
    .interactive-element:hover {
        transform: none;
    }
    
    .clickable-row:hover {
        transform: none;
        background-color: var(--primary-50);
    }
    
    .modern-btn {
        min-height: 48px;
        min-width: 48px;
    }
}

/* Better mobile navigation */
@media (max-width: 768px) {
    /* Floating action button for mobile */
    .fab {
        position: fixed;
        bottom: 24px;
        right: 24px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--gradient-primary);
        box-shadow: var(--shadow-lg);
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 24px;
        border: none;
        cursor: pointer;
        transition: all var(--transition-fast);
    }
    
    .fab:hover {
        transform: scale(1.1);
        box-shadow: var(--shadow-xl);
    }
    
    /* Better spacing for mobile */
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-modern {
        margin-bottom: 1rem;
    }
    
    .card-modern-body {
        padding: 1rem;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .fd-side-nav {
        width: 220px;
    }
    
    .fd-side-nav.collapsed {
        width: 60px;
    }
    
    .card-modern {
        margin-bottom: 1.5rem;
    }
}

/* ================= Micro-Animations & Transitions ================= */

/* Page transitions */
.page-enter {
    opacity: 0;
    transform: translateY(20px);
    animation: pageEnter 0.5s ease-out forwards;
}

@keyframes pageEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Stagger animations for lists */
.stagger-item {
    animation: staggerIn 0.5s ease-out both;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes staggerIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced focus states for accessibility */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
    border-radius: var(--radius-md);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* ================= Header & Footer ================= */
header.fd-shellbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    z-index: 1050;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

header.fd-shellbar .fd-shellbar__group--start {
    display: flex;
    align-items: center;
    gap: 15px;
}

header.fd-shellbar .fd-shellbar__group--end {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Header logo styling */
.header-logo-link {
    display: inline-block;
    transition: transform 0.2s ease;
}

.header-logo-link:hover {
    transform: scale(1.02);
}

.header-logo {
    display: block;
    width: auto;
    height: 40px;
    max-width: 100%;
    object-fit: contain;
}

/* Desktop: Larger logo */
@media (min-width: 992px) {
    .header-logo {
        height: 40px;
        max-width: 180px;
    }
}

/* Tablet */
@media (min-width: 576px) and (max-width: 991px) {
    .header-logo {
        height: 40px;
        max-width: 180px;
    }
}

/* Mobile: Smaller logo */
@media (max-width: 575px) {
    .header-logo {
        height: 20px;
        max-width: 80px;
    }
    
    header.fd-shellbar {
        padding: 0 10px;
    }
    
    .fd-shellbar__title {
        font-size: 0.85rem;
    }
}

footer.fd-bar--footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    z-index: 1050;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================= Sidebar ================= */
.fd-side-nav {
    width: 250px;
    position: fixed;
    top: 70px;
    bottom: 40px;
    left: 0;
    background: linear-gradient(180deg, var(--gray-800) 0%, var(--gray-900) 100%);
    color: white;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--transition-normal), left var(--transition-normal), opacity 0.3s ease, visibility 0.3s ease;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    scrollbar-width: thin;
    scrollbar-color: var(--gray-600) var(--gray-800);
    visibility: visible;
    opacity: 1;
}

/* Custom scrollbar for webkit browsers */
.fd-side-nav::-webkit-scrollbar {
    width: 6px;
}

.fd-side-nav::-webkit-scrollbar-track {
    background: var(--gray-800);
}

.fd-side-nav::-webkit-scrollbar-thumb {
    background: var(--gray-600);
    border-radius: 3px;
}

.fd-side-nav::-webkit-scrollbar-thumb:hover {
    background: var(--primary-500);
}

.fd-side-nav.collapsed {
    left: -250px !important;
    width: 0px !important;
    overflow: hidden !important;
    box-shadow: none !important;
    visibility: hidden;
    opacity: 0;
}

.fd-side-nav__link {
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.fd-side-nav__link:hover,
.fd-side-nav__link.is-active {
    background: linear-gradient(90deg, var(--primary-600) 0%, var(--primary-700) 100%);
    border-left: 4px solid var(--primary-400);
    padding-left: 16px;
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.fd-side-nav__link:hover {
    background: linear-gradient(90deg, var(--primary-600) 0%, var(--primary-700) 100%);
    box-shadow: var(--shadow-md);
}

.fd-side-nav__link.is-active {
    background-color: #2980b9;
    color: #ecf0f1;
    font-weight: 500;
    box-shadow: 0 2px 12px rgba(52, 152, 219, 0.3);
}

.fd-side-nav.collapsed .menu-text {
    display: none;
}

.fd-side-nav.collapsed .fd-side-nav__link.is-active {
    background: linear-gradient(90deg, var(--primary-600) 0%, var(--primary-700) 100%);
    border-left: 4px solid var(--primary-400);
    border-radius: 0 4px 4px 0;
    margin-left: -4px;
    position: relative;
}

.fd-side-nav.collapsed .fd-side-nav__link.is-active::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background-color: #3498db;
    border-radius: 0 2px 2px 0;
}

.fd-side-nav__link i.fas,
.fd-side-nav__link i.far,
.fd-side-nav__link i.fab {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fd-side-nav__link:hover i.fas,
.fd-side-nav__link:hover i.far,
.fd-side-nav__link:hover i.fab {
    transform: scale(1.1);
}

/* Notification badges */
.sidebar-badge {
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

.sidebar-badge.warning {
    background: #f39c12;
}

.sidebar-badge.success {
    background: #27ae60;
}

.sidebar-badge.info {
    background: #3498db;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Sidebar organization */
.sidebar-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent, #34495e, transparent);
    margin: 8px 0;
    border: none;
}

.sidebar-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 20px 4px 20px;
    margin: 0;
}

.fd-side-nav.collapsed .sidebar-group-title {
    display: none;
}

/* Sidebar toggle button (inside sidebar) */
.fd-side-nav .sidebar-toggle {
    position: absolute;
    top: 10px;
    right: -12px;
    width: 24px;
    height: 24px;
    background: #34495e;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1100;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 12px;
    opacity: 1;
    visibility: visible;
}

/* Desktop sidebar toggle button (in header) */
#desktopSidebarToggle {
    background: transparent;
    border: none;
    color: #2c3e50;
    font-size: 20px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
}

#desktopSidebarToggle:hover {
    color: #3498db;
    transform: scale(1.1);
}

#desktopSidebarToggle:active {
    transform: scale(0.95);
}

/* Mobile sidebar toggle button - hidden by default, shown on mobile */
#mobileSidebarToggle {
    display: none;
}

.fd-side-nav.collapsed .sidebar-toggle {
    opacity: 1;
    visibility: visible;
}

/* Show toggle button on hover of left edge when sidebar is collapsed */
body.with-sidebar.sidebar-collapsed::before {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 20px;
    z-index: 1099;
    background: transparent;
}

body.with-sidebar.sidebar-collapsed:hover .sidebar-toggle {
    opacity: 1;
    visibility: visible;
}

.sidebar-toggle:hover {
    background: #2980b9;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 1;
}

/* ================= Content ================= */
body.with-sidebar main,
body.with-sidebar .module-header,
body.with-sidebar .flash-container {
    margin-left: 250px;
    transition: margin-left 0.3s ease;
}

body.with-sidebar.sidebar-collapsed main,
body.with-sidebar.sidebar-collapsed .module-header,
body.with-sidebar.sidebar-collapsed .flash-container {
    margin-left: 0px;
}

body:not(.with-sidebar) main,
body:not(.with-sidebar) .module-header,
body:not(.with-sidebar) .flash-container {
    margin-left: 0;
}

main.container-fluid {
    padding-top: 90px;
    padding-bottom: 120px;
    overflow-y: auto;
    min-height: calc(100vh - 70px - 40px); /* viewport height minus header and footer */
}

/* Ensure pagination and bottom elements are visible above footer */
.pagination-wrapper,
.d-flex.justify-content-between.align-items-center {
    margin-bottom: 40px;
}

.module-header {
    margin-left: 220px;
    margin-top: 75px;
    transition: margin-left 0.3s ease;
}

body.sidebar-collapsed .module-header {
    margin-left: 0px;
}

.flash-container {
    position: fixed;
    top: 70px;
    right: 20px;
    max-width: 350px;
    z-index: 300;
    transition: margin-left 0.3s ease;
}

body.sidebar-collapsed .flash-container {
    margin-left: 0px;
}

/* ================= Mobile ================= */
@media (max-width: 992px) {
    .fd-side-nav {
        left: -250px;
        width: 250px;
        z-index: 1050; /* Higher z-index for mobile overlay */
        transition: left 0.3s ease;
    }

    .fd-side-nav.show {
        left: 0;
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.3);
    }

    /* Mobile sidebar backdrop/overlay */
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1049; /* Just below sidebar */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

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

    /* Prevent body scroll when mobile sidebar is open */
    body.sidebar-mobile-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    body.with-sidebar main,
    body.with-sidebar.sidebar-collapsed main,
    body.with-sidebar .module-header,
    body.with-sidebar .flash-container {
        margin-left: 0;
    }

    /* Mobile sidebar toggle button in header */
    #mobileSidebarToggle {
        display: block;
        background: none;
        border: none;
        color: var(--primary-600);
        font-size: 1.2rem;
        padding: 8px;
        border-radius: 4px;
        transition: background-color 0.2s ease;
    }

    #mobileSidebarToggle:hover {
        background-color: rgba(0, 123, 255, 0.1);
    }

    /* Add close button to mobile sidebar */
    .fd-side-nav.show .sidebar-close {
        position: absolute;
        top: 10px;
        right: 10px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: white;
        font-size: 1.2rem;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1051;
        transition: background-color 0.2s ease;
    }

    .fd-side-nav.show .sidebar-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* ================= Desktop Styles ================= */
@media (min-width: 992px) {
    /* Hide mobile sidebar toggle on desktop */
    #mobileSidebarToggle {
        display: none;
    }
    
    /* Show desktop sidebar toggle on desktop */
    #desktopSidebarToggle {
        display: block;
    }
    
    /* Desktop sidebar styling */
    .fd-side-nav {
        width: 250px;
    }
    
    /* Collapsed sidebar on desktop */
    .fd-side-nav.collapsed {
        left: -250px !important;
        width: 0px !important;
    }
    
    /* Ensure content has proper margin on desktop */
    body.with-sidebar main,
    body.with-sidebar .module-header,
    body.with-sidebar .flash-container {
        margin-left: 250px;
    }
    
    /* When sidebar is collapsed, remove the margin */
    body.with-sidebar.sidebar-collapsed main,
    body.with-sidebar.sidebar-collapsed .module-header,
    body.with-sidebar.sidebar-collapsed .flash-container {
        margin-left: 0px !important;
    }
    
    /* Better spacing for desktop content */
    main.container-fluid {
        padding-left: 30px;
        padding-right: 30px;
    }
}

/* Logo hover indicator */
.fd-shellbar__group--start a:hover img {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Logo hover indicator */
.fd-shellbar__group--start a:hover img {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

body.dark-mode header.fd-shellbar {
    background-color: #34495e;
}

body.dark-mode .fd-side-nav {
    background-color: #2c3e50;
}

body.dark-mode .fd-side-nav__link {
    color: white;
}

body.dark-mode .flash-container {
    background-color: #34495e;
}

body.dark-mode .module-header {
    background-color: #2c3e50;
}

body.dark-mode .sidebar-toggle {
    background-color: #34495e;
}

body.dark-mode .sidebar-toggle:hover {
    background-color: #34495e;
}

/* ====== Dark Mode: Tables ====== */
body.dark-mode .table {
    background-color: #1e1e1e;
    color: #e6e6e6;
}

body.dark-mode .table th,
body.dark-mode .table td {
    border-color: #444;
}

body.dark-mode .table thead th {
    background-color: #2a2a2a;
    color: #f0f0f0;
}

body.dark-mode .table tfoot th,
body.dark-mode .table tfoot td {
    background-color: #2a2a2a;
    color: #f0f0f0;
}

body.dark-mode .table-bordered {
    border-color: #444;
}

/* Bootstrap utility classes often used in headers */
body.dark-mode .table .table-light,
body.dark-mode .table .table-light>th,
body.dark-mode .table .table-light>td {
    background-color: #2a2a2a !important;
    color: #e6e6e6 !important;
}

/* Handle table-primary variant in dark mode */
body.dark-mode .table .table-primary,
body.dark-mode .table .table-primary>th,
body.dark-mode .table .table-primary>td {
    background-color: #1a4a7a !important; /* Darker blue for dark mode */
    color: #ffffff !important;
}

/* Handle text-dark utility class in dark mode */
body.dark-mode .text-dark {
    color: #e6e6e6 !important;
}

/* Handle other Bootstrap table variants */
body.dark-mode .table .table-secondary,
body.dark-mode .table .table-secondary>th,
body.dark-mode .table .table-secondary>td {
    background-color: #2a2a2a !important;
    color: #e6e6e6 !important;
}

body.dark-mode .table .table-success,
body.dark-mode .table .table-success>th,
body.dark-mode .table .table-success>td {
    background-color: #1a4a1a !important;
    color: #ffffff !important;
}

body.dark-mode .table .table-danger,
body.dark-mode .table .table-danger>th,
body.dark-mode .table .table-danger>td {
    background-color: #4a1a1a !important;
    color: #ffffff !important;
}

body.dark-mode .table .table-warning,
body.dark-mode .table .table-warning>th,
body.dark-mode .table .table-warning>td {
    background-color: #4a4a1a !important;
    color: #ffffff !important;
}

body.dark-mode .table .table-info,
body.dark-mode .table .table-info>th,
body.dark-mode .table .table-info>td {
    background-color: #1a4a4a !important;
    color: #ffffff !important;
}

/* ================= Dark Mode: Bootstrap Utility Classes ================= */
/* Background colors */
body.dark-mode .bg-primary {
    background-color: #0d6efd !important;
}

body.dark-mode .bg-secondary {
    background-color: #6c757d !important;
}

body.dark-mode .bg-success {
    background-color: #198754 !important;
}

body.dark-mode .bg-danger {
    background-color: #dc3545 !important;
}

body.dark-mode .bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

body.dark-mode .bg-info {
    background-color: #0dcaf0 !important;
    color: #000 !important;
}

body.dark-mode .bg-light {
    background-color: #2a2a2a !important;
    color: #e6e6e6 !important;
}

body.dark-mode .bg-dark {
    background-color: #1a1a1a !important;
}

body.dark-mode .bg-white {
    background-color: #1e1e1e !important;
    color: #e6e6e6 !important;
}

/* Text colors */
body.dark-mode .text-primary {
    color: #0d6efd !important;
}

body.dark-mode .text-secondary {
    color: #6c757d !important;
}

body.dark-mode .text-success {
    color: #198754 !important;
}

body.dark-mode .text-danger {
    color: #dc3545 !important;
}

body.dark-mode .text-warning {
    color: #ffc107 !important;
}

body.dark-mode .text-info {
    color: #0dcaf0 !important;
}

body.dark-mode .text-light {
    color: #f8f9fa !important;
}

body.dark-mode .text-dark {
    color: #e6e6e6 !important;
}

body.dark-mode .text-muted {
    color: #9a9a9a !important;
}

body.dark-mode .text-white {
    color: #ffffff !important;
}

/* Border colors */
body.dark-mode .border {
    border-color: #444 !important;
}

body.dark-mode .border-primary {
    border-color: #0d6efd !important;
}

body.dark-mode .border-secondary {
    border-color: #6c757d !important;
}

body.dark-mode .border-success {
    border-color: #198754 !important;
}

body.dark-mode .border-danger {
    border-color: #dc3545 !important;
}

body.dark-mode .border-warning {
    border-color: #ffc107 !important;
}

body.dark-mode .border-info {
    border-color: #0dcaf0 !important;
}

body.dark-mode .border-light {
    border-color: #444 !important;
}

body.dark-mode .border-dark {
    border-color: #1a1a1a !important;
}

/* ================= Dark Mode: Cards ================= */
body.dark-mode .card {
    background-color: #1e1e1e;
    border-color: #444;
    color: #e6e6e6;
}

body.dark-mode .card-header {
    background-color: #2a2a2a;
    border-bottom-color: #444;
    color: #e6e6e6;
}

body.dark-mode .card-body {
    background-color: #1e1e1e;
    color: #e6e6e6;
}

body.dark-mode .card-footer {
    background-color: #2a2a2a;
    border-top-color: #444;
    color: #e6e6e6;
}

body.dark-mode .card-title {
    color: #ffffff;
}

body.dark-mode .card-text {
    color: #e6e6e6;
}

/* ================= Dark Mode: Forms ================= */
body.dark-mode .form-control {
    background-color: #2a2a2a;
    border-color: #444;
    color: #e6e6e6;
}

body.dark-mode .form-control:focus {
    background-color: #2a2a2a;
    border-color: #0d6efd;
    color: #e6e6e6;
}

body.dark-mode .form-control::placeholder {
    color: #9a9a9a;
}

body.dark-mode .form-select {
    background-color: #2a2a2a;
    border-color: #444;
    color: #e6e6e6;
}

body.dark-mode .form-select:focus {
    background-color: #2a2a2a;
    border-color: #0d6efd;
    color: #e6e6e6;
}

body.dark-mode .form-label {
    color: #e6e6e6;
}

body.dark-mode .input-group-text {
    background-color: #2a2a2a;
    border-color: #444;
    color: #e6e6e6;
}

/* ================= Dark Mode: Buttons ================= */
body.dark-mode .btn-outline-primary {
    color: #0d6efd;
    border-color: #0d6efd;
    background-color: transparent;
}

body.dark-mode .btn-outline-primary:hover {
    color: #ffffff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

body.dark-mode .btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
    background-color: transparent;
}

body.dark-mode .btn-outline-secondary:hover {
    color: #ffffff;
    background-color: #6c757d;
    border-color: #6c757d;
}

body.dark-mode .btn-outline-success {
    color: #198754;
    border-color: #198754;
    background-color: transparent;
}

body.dark-mode .btn-outline-success:hover {
    color: #ffffff;
    background-color: #198754;
    border-color: #198754;
}

body.dark-mode .btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
    background-color: transparent;
}

body.dark-mode .btn-outline-danger:hover {
    color: #ffffff;
    background-color: #dc3545;
    border-color: #dc3545;
}

body.dark-mode .btn-outline-warning {
    color: #ffc107;
    border-color: #ffc107;
    background-color: transparent;
}

body.dark-mode .btn-outline-warning:hover {
    color: #000;
    background-color: #ffc107;
    border-color: #ffc107;
}

body.dark-mode .btn-outline-info {
    color: #0dcaf0;
    border-color: #0dcaf0;
    background-color: transparent;
}

body.dark-mode .btn-outline-info:hover {
    color: #000;
    background-color: #0dcaf0;
    border-color: #0dcaf0;
}

body.dark-mode .btn-outline-light {
    color: #f8f9fa;
    border-color: #f8f9fa;
    background-color: transparent;
}

body.dark-mode .btn-outline-light:hover {
    color: #000;
    background-color: #f8f9fa;
    border-color: #f8f9fa;
}

/* ================= Dark Mode: Badges ================= */
body.dark-mode .badge {
    color: #ffffff;
}

/* ================= Dark Mode: Links ================= */
body.dark-mode a {
    color: #0d6efd;
}

body.dark-mode a:hover {
    color: #0b5ed7;
}

body.dark-mode .text-decoration-none {
    color: inherit;
}

/* Striped and hover states */
body.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    background-color: #232323;
}

body.dark-mode .table-striped tbody tr:nth-of-type(even) {
    background-color: #1e1e1e;
}

body.dark-mode .table-hover tbody tr:hover {
    background-color: #2f2f2f;
    color: #ffffff;
}

/* Optional: Inputs inside tables for better readability in dark mode */
body.dark-mode .table .form-control,
body.dark-mode .table .form-select {
    background-color: #1a1a1a;
    color: #e6e6e6;
    border-color: #444;
}

body.dark-mode .table .form-control::placeholder {
    color: #9a9a9a;
}

/* Flash Close Button - Top Right */
.fd-button {
    position: absolute;
    /* absolute inside message strip */
    top: 4px;
    /* adjust vertical position */
    right: 4px;
    /* adjust horizontal position */
    background-color: red;
    color: #fff;
    border: none;
    border-radius: 20%;
    width: 5px;
    height: 20px;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.fd-button:hover {
    background-color: darkred;
}

/* ================= Page Loader Overlay ================= */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.page-loader[aria-hidden="false"]:not(.force-hidden),
.page-loader.show:not(.force-hidden) {
    display: flex;
    pointer-events: auto;
}

.page-loader[aria-hidden="true"],
.page-loader.force-hidden {
    display: none !important;
}

/* Prevent loader on notification-triggered refreshes */
body.notification-refresh .page-loader {
    display: none !important;
}

.page-loader__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 2001;
    transition: background 0.2s;
}

.page-loader__backdrop::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35); /* fallback solid color, no blur */
    z-index: -1;
}

.page-loader__content {
    position: relative;
    z-index: 2002;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    min-width: 120px;
    isolation: isolate;
    transform: translateZ(0);
    will-change: opacity, transform;
    backface-visibility: hidden;
    /* Force new stacking context */
    position: relative;
}

/* Dark mode support for loader */
.dark-mode .page-loader__backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.dark-mode .page-loader__content {
    background: #2c3e50;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.page-loader__spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
}

/* ================= Flash Toasts ================= */
.toast-header strong {
    color: #212529 !important;
}

.toast-body {
    color: #212529 !important;
}

body.dark-mode .toast-header strong,
body.dark-mode .toast-body {
    color: #fff !important;
}

/* ================= Toast Notification Enhancements ================= */
.toast-container {
    z-index: 9999 !important;
}

.toast {
    background: #fff !important;
    color: #222 !important;
    border: 2px solid #007bff !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    opacity: 0.98 !important;
    filter: none !important;
}

.toast-header {
    background: #007bff !important;
    color: #fff !important;
    font-weight: bold;
}

.toast-body {
    font-size: 1.1em;
    font-weight: 500;
}

/* ================= Module Header ================= */
.module-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.module-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #495057;
    margin: 0;
    padding: 0 1rem;
}

/* Dark mode support for module header */
body.dark-mode .module-header {
    background-color: #2c3e50;
    border-bottom-color: #34495e;
}

body.dark-mode .module-title {
    color: #ecf0f1;
}

/* Header modern buttons */
.modern-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 16px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.modern-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.modern-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.modern-btn:hover::before {
    width: 300px;
    height: 300px;
}

.modern-btn:active {
    transform: translateY(0) scale(0.95);
}

/* Notification button states */
.modern-btn.notification-enabled {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.modern-btn.notification-partial {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.modern-btn.notification-disabled {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.modern-btn.notification-disabled:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ================= TABLET LANDSCAPE OPTIMIZATIONS ================= */

/* Tablet Landscape: 768px to 1024px width, landscape orientation */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    /* Sidebar optimizations for tablet landscape */
    .fd-side-nav {
        width: 220px; /* Slightly narrower sidebar */
        font-size: 0.9rem; /* Slightly smaller text */
    }

    .fd-side-nav.collapsed {
        left: -220px !important;
        width: 0px !important;
    }

    /* Content margin adjustments */
    body.with-sidebar main,
    body.with-sidebar .module-header,
    body.with-sidebar .flash-container {
        margin-left: 220px;
    }

    body.with-sidebar.sidebar-collapsed main,
    body.with-sidebar.sidebar-collapsed .module-header,
    body.with-sidebar.sidebar-collapsed .flash-container {
        margin-left: 0px !important;
    }

    /* Sidebar link optimizations */
    .fd-side-nav__link {
        padding: 10px 16px; /* Slightly smaller padding */
        font-size: 0.85rem;
    }

    .fd-side-nav__link i.fas,
    .fd-side-nav__link i.far,
    .fd-side-nav__link i.fab {
        width: 18px;
        font-size: 1rem;
    }

    /* Header optimizations */
    header.fd-shellbar {
        padding: 0 15px;
    }

    .header-logo {
        height: 35px;
        max-width: 150px;
    }

    /* Main content optimizations */
    main.container-fluid {
        padding-left: 20px;
        padding-right: 20px;
        padding-top: 20px;
    }

    /* Table optimizations for tablets */
    .table-responsive {
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .table {
        font-size: 0.85rem; /* Slightly smaller font for more content */
        margin-bottom: 0;
    }

    .table th,
    .table td {
        padding: 8px 12px; /* Optimized padding for tablets */
        vertical-align: middle;
    }

    .table th {
        font-weight: 600;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        background-color: #f8f9fa;
        border-bottom: 2px solid #dee2e6;
    }

    /* Form control optimizations */
    .form-control,
    .form-select {
        font-size: 0.9rem;
        padding: 8px 12px;
        border-radius: 6px;
        border: 1px solid #ced4da;
        transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    }

    .form-control:focus,
    .form-select:focus {
        border-color: #80bdff;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }

    /* Button optimizations for tablets */
    .btn {
        font-size: 0.9rem;
        padding: 8px 16px;
        border-radius: 6px;
        font-weight: 500;
        min-height: 38px; /* Better touch targets */
        transition: all 0.2s ease;
    }

    .btn-sm {
        font-size: 0.8rem;
        padding: 6px 12px;
        min-height: 32px;
    }

    /* Card optimizations */
    .card {
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border: 1px solid #e9ecef;
    }

    .card-header {
        background-color: #f8f9fa;
        border-bottom: 1px solid #e9ecef;
        padding: 12px 16px;
        font-weight: 600;
        font-size: 0.9rem;
    }

    .card-body {
        padding: 16px;
    }

    /* Tab optimizations */
    .nav-tabs .nav-link {
        font-size: 0.85rem;
        padding: 8px 16px;
        border-radius: 6px 6px 0 0;
        margin-right: 4px;
        font-weight: 500;
    }

    .nav-tabs .nav-link.active {
        background-color: #007bff;
        color: white;
        border-color: #007bff #007bff #fff;
    }

    /* Badge optimizations */
    .badge {
        font-size: 0.75rem;
        padding: 4px 8px;
        border-radius: 12px;
        font-weight: 600;
    }

    /* Modal optimizations for tablets */
    .modal-dialog {
        margin: 30px auto;
        max-width: 90vw;
    }

    .modal-content {
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }

    .modal-header {
        padding: 16px 20px;
        border-bottom: 1px solid #e9ecef;
    }

    .modal-body {
        padding: 20px;
        max-height: 70vh;
        overflow-y: auto;
    }

    .modal-footer {
        padding: 16px 20px;
        border-top: 1px solid #e9ecef;
    }

    /* Loading spinner optimizations */
    .loading-spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
    }

    .loading-text {
        font-size: 0.9rem;
    }

    /* Flash message optimizations */
    .flash-container {
        max-width: 95vw;
        right: 15px;
    }

    .alert {
        border-radius: 6px;
        font-size: 0.9rem;
        padding: 12px 16px;
    }

    /* Specific delivery management optimizations */
    #so_table th:nth-child(1), /* Order # */
    #so_table td:nth-child(1) {
        min-width: 100px;
        max-width: 120px;
    }

    #so_table th:nth-child(2), /* Date */
    #so_table td:nth-child(2) {
        min-width: 90px;
        max-width: 110px;
    }

    #so_table th:nth-child(3), /* Order Total */
    #so_table td:nth-child(3) {
        min-width: 100px;
        max-width: 120px;
        text-align: right;
    }

    #so_table th:nth-child(4), /* Customer Name */
    #so_table td:nth-child(4) {
        min-width: 150px;
        max-width: 200px;
    }

    #so_table th:nth-child(5), /* Warehouse Code */
    #so_table td:nth-child(5) {
        min-width: 120px;
        max-width: 140px;
    }

    #so_table th:nth-child(6), /* Phone */
    #so_table td:nth-child(6) {
        min-width: 120px;
        max-width: 140px;
    }

    #so_table th:nth-child(7), /* Alt Phone */
    #so_table td:nth-child(7) {
        min-width: 120px;
        max-width: 140px;
    }

    #so_table th:nth-child(8), /* DLN */
    #so_table td:nth-child(8) {
        min-width: 80px;
        max-width: 100px;
    }

    #so_table th:nth-child(9), /* Confirmation Status */
    #so_table td:nth-child(9) {
        min-width: 140px;
        max-width: 160px;
    }

    /* Filter row optimizations */
    .row.mb-3 .col-md-2,
    .row.mb-3 .col-md-3 {
        margin-bottom: 12px;
    }

    /* Button group optimizations */
    .d-flex.align-items-end.gap-2 {
        flex-wrap: wrap;
        gap: 8px !important;
    }

    .d-flex.align-items-end.gap-2 .btn {
        flex: 1;
        min-width: 120px;
    }

    /* Responsive table wrapper */
    .table-responsive {
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
}

/* ================= GENERAL TABLET OPTIMIZATIONS ================= */

/* All tablets: 768px to 1024px width (both orientations) */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Touch-friendly improvements */
    .btn,
    .form-control,
    .form-select,
    .nav-link {
        min-height: 44px; /* Apple's recommended touch target size */
        touch-action: manipulation; /* Prevent double-tap zoom */
    }

    /* Better spacing for tablet screens */
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Optimize cards for tablet screens */
    .card {
        margin-bottom: 20px;
    }

    /* Better modal sizing for tablets */
    .modal-lg {
        max-width: 85vw;
    }

    /* Improve table readability on tablets */
    .table-responsive {
        margin: 0 -10px;
        padding: 0 10px;
    }

    /* Sidebar toggle improvements for tablets */
    .sidebar-toggle {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    /* Header improvements for tablets */
    .fd-shellbar__title {
        font-size: 1.1rem;
        font-weight: 600;
    }
}

/* ================= PORTRAIT TABLET SPECIFIC ================= */

/* Portrait tablets: 768px to 1024px width, portrait orientation */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    /* More compact sidebar for portrait tablets */
    .fd-side-nav {
        width: 200px;
        font-size: 0.85rem;
    }

    .fd-side-nav.collapsed {
        left: -200px !important;
    }

    body.with-sidebar main,
    body.with-sidebar .module-header,
    body.with-sidebar .flash-container {
        margin-left: 200px;
    }

    /* Stack filter controls vertically on portrait tablets */
    .row.mb-3 {
        --bs-gutter-x: 0.5rem;
    }

    .row.mb-3 .col-md-2,
    .row.mb-3 .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
        margin-bottom: 10px;
    }

    /* Smaller buttons for portrait tablets */
    .btn {
        font-size: 0.85rem;
        padding: 6px 12px;
        min-height: 36px;
    }

    /* Compact table for portrait tablets */
    .table th,
    .table td {
        padding: 6px 8px;
        font-size: 0.8rem;
    }

    /* Reduce card padding for portrait tablets */
    .card-body {
        padding: 12px;
    }
}

/* ================= MICRO-ANIMATIONS & TRANSITIONS ================= */

/* Stagger animations for card entrance */
.card-modern {
    animation: cardSlideIn 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.card-modern:nth-child(1) { animation-delay: 0.1s; }
.card-modern:nth-child(2) { animation-delay: 0.2s; }
.card-modern:nth-child(3) { animation-delay: 0.3s; }
.card-modern:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page transition effects */
.page-transition {
    animation: pageFadeIn 0.5s ease-out;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button hover micro-interactions */
.modern-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.modern-btn:hover::before {
    width: 300px;
    height: 300px;
}

.modern-btn-outline::before {
    background: rgba(0, 123, 255, 0.1);
}

/* Form control focus animations */
.form-control-modern,
.form-select-modern {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control-modern:focus,
.form-select-modern:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
}

/* Table row hover animations */
.modern-table tbody tr {
    transition: all 0.2s ease;
}

.modern-table tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Loading state animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Success/Error state animations */
.alert-success, .alert-danger, .alert-warning, .alert-info {
    animation: alertSlideIn 0.4s ease-out;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}