/* Invoice Management System - Custom Styles */

:root {
    --sidebar-width: 250px;
    --animation-duration: 0.3s;
    --animation-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-size: 0.875rem;
    animation: fadeIn 0.5s ease-in;
    background: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 70px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    overflow-y: auto;
    transition: transform var(--animation-duration) var(--animation-timing);
}

/* Mobile sidebar toggle animation */
@media (max-width: 767.98px) {
    .modern-sidebar {
        box-shadow: 2px 0 30px rgba(0, 0, 0, 0.2);
    }
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    margin: 0.25rem 0.5rem;
    transition: all var(--animation-duration) var(--animation-timing);
    position: relative;
    overflow: hidden;
}

.sidebar .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: #0d6efd;
    transform: scaleY(0);
    transition: transform var(--animation-duration) var(--animation-timing);
}

.sidebar .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #0d6efd;
    transform: translateX(5px);
}

.sidebar .nav-link:hover::before {
    transform: scaleY(1);
}

.sidebar .nav-link.active {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
    transform: translateX(5px);
}

.sidebar .nav-link.active::before {
    transform: scaleY(1);
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    transition: all var(--animation-duration) var(--animation-timing);
    display: inline-block;
}

.sidebar .nav-link:hover i {
    transform: scale(1.2) rotate(5deg);
}

.sidebar .nav-link.active i {
    transform: scale(1.1);
    color: #0d6efd;
}

main {
    margin-left: 0;
    min-height: calc(100vh - 70px);
    background: #f8f9fa;
}

.card {
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    transition: all var(--animation-duration) var(--animation-timing);
    animation: slideUp 0.5s ease-out;
    background: white;
    overflow: hidden;
}

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

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 600;
}

.table th {
    font-weight: 600;
    border-top: none;
    transition: background-color var(--animation-duration) var(--animation-timing);
}

.table tbody tr {
    transition: all var(--animation-duration) var(--animation-timing);
}

.table tbody tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    transition: all var(--animation-duration) var(--animation-timing);
}

.btn {
    transition: all var(--animation-duration) var(--animation-timing);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    font-weight: 500;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.btn-success:hover {
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.4);
}

.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.min-vh-100 {
    min-height: 100vh;
}

.item-row {
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    transition: all var(--animation-duration) var(--animation-timing);
    animation: slideIn 0.3s ease-out;
}

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

.item-row:hover {
    background-color: #e9ecef;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.item-row.removing {
    animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(-20px);
        max-height: 0;
        margin: 0;
        padding: 0;
    }
}

/* Print styles */
@media print {
    .navbar,
    .sidebar,
    .btn,
    .border-bottom,
    .d-flex.justify-content-between {
        display: none !important;
    }
    
    main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        border: none;
        box-shadow: none;
    }
}

/* Flash messages */
.alert {
    border-radius: 0.5rem;
    animation: slideDown 0.5s ease-out;
    transition: all var(--animation-duration) var(--animation-timing);
}

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

.alert.show {
    animation: slideDown 0.5s ease-out;
}

.alert.fade {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Status badges */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
}

/* Form validation */
.form-label .text-danger {
    font-weight: 600;
}

/* Form input animations */
.form-control {
    transition: all var(--animation-duration) var(--animation-timing);
    border: 1px solid #ced4da;
}

.form-control:focus {
    transform: scale(1.01);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    border-color: #667eea;
}

.form-select:focus {
    transform: scale(1.01);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    border-color: #667eea;
}

/* Loading spinner */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in;
}

.loading-overlay.hidden {
    animation: fadeOut 0.3s ease-out forwards;
}

/* Dashboard cards animation */
.card.text-white {
    transition: all var(--animation-duration) var(--animation-timing);
    position: relative;
    overflow: hidden;
}

.card.text-white::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--animation-duration) var(--animation-timing);
}

.card.text-white:hover::before {
    opacity: 1;
}

.card.text-white:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Badge animations */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
    transition: all var(--animation-duration) var(--animation-timing);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.badge:hover {
    transform: scale(1.1);
}

/* Page content fade in */
main {
    animation: fadeInUp 0.6s ease-out;
}

/* Page title styling */
.h2 {
    font-weight: 700;
    color: #2d3748;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.border-bottom {
    border-bottom: 2px solid rgba(102, 126, 234, 0.1) !important;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

/* Enhanced page headers */
.d-flex.justify-content-between.align-items-center {
    padding: 1.5rem 0;
}

/* Modern button styles */
.btn-secondary {
    background: #6c757d;
    border: none;
    font-weight: 500;
    border-radius: 8px;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    font-weight: 500;
    border-radius: 8px;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    transform: translateY(-2px);
}

.btn-outline-danger {
    border: 2px solid #ee0979;
    color: #ee0979;
    font-weight: 500;
    border-radius: 8px;
}

.btn-outline-danger:hover {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
    border-color: #ee0979;
    color: white;
    transform: translateY(-2px);
}

.btn-outline-secondary {
    border: 2px solid #6c757d;
    color: #6c757d;
    font-weight: 500;
    border-radius: 8px;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-2px);
}

/* Table enhancements */
.table {
    border-radius: 12px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #495057;
    padding: 1rem;
}

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

/* Badge enhancements */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 600;
    border-radius: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

/* Form enhancements */
.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all var(--animation-duration) var(--animation-timing);
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

/* Search input styling */
input[type="text"][name="search"],
input[type="text"][placeholder*="Search"] {
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    border: 2px solid #e9ecef;
}

input[type="text"][name="search"]:focus,
input[type="text"][placeholder*="Search"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

/* Select dropdown styling */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23667eea' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

/* Enhanced card headers */
.card-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h5 i {
    color: #667eea;
    font-size: 1.1rem;
}

/* Empty state styling */
.text-center {
    padding: 3rem 1rem;
    color: #6c757d;
}

/* Enhanced section dividers */
hr {
    border: none;
    border-top: 2px solid rgba(102, 126, 234, 0.1);
    margin: 2rem 0;
}

/* Modern scrollbar for main content */
main::-webkit-scrollbar {
    width: 8px;
}

main::-webkit-scrollbar-track {
    background: transparent;
}

main::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

main::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* Page container enhancements */
.container-fluid {
    padding-left: 2rem;
    padding-right: 2rem;
}

@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Enhanced text colors */
.text-muted {
    color: #6c757d !important;
}

/* Modern card shadows */
.card {
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.card:hover {
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

/* Status badge modern design */
.badge.bg-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%) !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, #3494e6 0%, #ec6ead 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
}

/* Input group enhancements */
.input-group-text {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e9ecef;
    border-right: none;
    border-radius: 8px 0 0 8px;
}

/* Modern textarea */
textarea.form-control {
    border-radius: 8px;
    min-height: 100px;
}

/* Enhanced table actions */
.table .btn-sm {
    margin: 0 0.25rem;
    border-radius: 6px;
    font-weight: 500;
}

/* Modern filter section */
.card .card-body form {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

/* Enhanced page titles */
.h2 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Modern input groups */
.input-group .form-control {
    border-radius: 8px 0 0 8px;
}

.input-group .btn {
    border-radius: 0 8px 8px 0;
}

/* Enhanced pagination */
.pagination {
    gap: 0.5rem;
}

.page-link {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.5rem 0.75rem;
    color: #667eea;
    font-weight: 500;
}

.page-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

/* Responsive navbar */
@media (max-width: 991.98px) {
    .modern-navbar {
        padding: 0.75rem 0;
    }
    
    .brand-title {
        font-size: 1.1rem;
    }
    
    .brand-subtitle {
        font-size: 0.7rem;
    }
    
    .user-name {
        display: none;
    }
    
    .modern-sidebar {
        margin-top: 0;
    }
}

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

/* Modern Navbar Design */
.modern-navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    transition: all var(--animation-duration) var(--animation-timing);
    position: relative;
    z-index: 1000;
}

.modern-navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.modern-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: white !important;
    transition: all var(--animation-duration) var(--animation-timing);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.modern-brand:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
}

.brand-icon {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all var(--animation-duration) var(--animation-timing);
    backdrop-filter: blur(10px);
}

.modern-brand:hover .brand-icon {
    transform: rotate(10deg) scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 400;
    line-height: 1;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem !important;
    border-radius: 50px;
    transition: all var(--animation-duration) var(--animation-timing);
    color: white !important;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: white !important;
}

.user-avatar {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.modern-dropdown {
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    animation: slideDown 0.3s ease-out;
}

.modern-dropdown .dropdown-item {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all var(--animation-duration) var(--animation-timing);
    margin: 0.25rem 0;
}

.modern-dropdown .dropdown-item {
    display: flex;
    align-items: center;
}

.modern-dropdown .dropdown-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(5px);
}

.modern-dropdown .dropdown-item i {
    width: 20px;
    text-align: center;
}

.modern-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.modern-toggler {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all var(--animation-duration) var(--animation-timing);
}

.modern-toggler:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.modern-toggler span {
    display: block;
    width: 100%;
    height: 3px;
    background: white;
    transition: all var(--animation-duration) var(--animation-timing);
    border-radius: 2px;
    transform-origin: center;
}

.modern-toggler.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.modern-toggler.active span:nth-child(2) {
    opacity: 0;
}

.modern-toggler.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.modern-toggler:hover span {
    background: rgba(255, 255, 255, 0.9);
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.sidebar-overlay.show {
    display: block;
}

/* Modern Sidebar Design */
.modern-sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.05);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    min-height: calc(100vh - 70px);
    padding: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile: Hidden by default, fixed when shown */
@media (max-width: 767.98px) {
    .modern-sidebar {
        position: fixed;
        top: 70px;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        z-index: 1000;
        transform: translateX(-100%);
        overflow-y: auto;
    }
    
    .modern-sidebar.show {
        transform: translateX(0);
    }
}

/* Desktop: Normal flow, scrolls with page */
@media (min-width: 768px) {
    .modern-sidebar {
        position: relative;
        transform: translateX(0);
    }
}

.sidebar-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modern-nav {
    padding: 0.5rem 0;
}

.modern-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    margin: 0.25rem 0.75rem;
    border-radius: 12px;
    color: #495057;
    text-decoration: none;
    transition: all var(--animation-duration) var(--animation-timing);
    position: relative;
    font-weight: 500;
    border: 2px solid transparent;
}

.modern-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 4px;
    height: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0 4px 4px 0;
    transition: all var(--animation-duration) var(--animation-timing);
}

.modern-nav-link:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    transform: translateX(5px);
    border-color: rgba(102, 126, 234, 0.2);
}

.modern-nav-link:hover::before {
    transform: translateY(-50%) scaleY(1);
    height: 60%;
}

.modern-nav-link.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    color: #667eea;
    border-color: rgba(102, 126, 234, 0.3);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.modern-nav-link.active::before {
    transform: translateY(-50%) scaleY(1);
    height: 60%;
}

.nav-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all var(--animation-duration) var(--animation-timing);
    color: #667eea;
}

.modern-nav-link:hover .nav-icon,
.modern-nav-link.active .nav-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.1);
}

.nav-text {
    flex: 1;
    font-size: 0.95rem;
}

/* Navbar animations */
.navbar {
    transition: all var(--animation-duration) var(--animation-timing);
}

.navbar-brand {
    transition: all var(--animation-duration) var(--animation-timing);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

/* Table animations */
.table-responsive {
    animation: fadeIn 0.5s ease-out;
}

/* Print styles - disable animations */
@media print {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .modern-sidebar {
        position: fixed;
        top: 70px;
        left: 0;
        width: 280px;
        max-width: 85vw;
        transform: translateX(-100%);
        z-index: 1000;
    }
    
    .modern-sidebar.show {
        transform: translateX(0);
    }
    
    main {
        margin-left: 0;
        width: 100%;
    }
    
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .modern-brand .brand-subtitle {
        display: none;
    }
    
    .user-name {
        display: none;
    }
    
    .user-profile {
        padding: 0.5rem !important;
    }
    
    .sidebar {
        position: relative;
        top: 0;
        padding: 1rem 0;
        transition: transform var(--animation-duration) var(--animation-timing);
    }
}

/* Additional professional touches */
.navbar-brand {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.nav-link {
    transition: all var(--animation-duration) var(--animation-timing);
}

.nav-link:hover {
    transform: translateY(-2px);
}

/* Smooth transitions for all interactive elements */
a, button, input, select, textarea {
    transition: all var(--animation-duration) var(--animation-timing);
}

/* Enhanced focus states */
*:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

/* Card entrance animations with stagger */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }

/* Icon animations */
.stat-icon {
    transition: all var(--animation-duration) var(--animation-timing);
}

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

/* Table enhancements */
.table thead th {
    background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
    border-bottom: 2px solid #dee2e6;
}

/* Form group animations */
.form-group, .mb-3 {
    transition: all var(--animation-duration) var(--animation-timing);
}

/* Success/Error message enhancements */
.alert-success {
    border-left: 4px solid #198754;
    animation: slideDown 0.5s ease-out;
}

.alert-danger {
    border-left: 4px solid #dc3545;
    animation: slideDown 0.5s ease-out;
}

.alert-info {
    border-left: 4px solid #0dcaf0;
    animation: slideDown 0.5s ease-out;
}

.alert-warning {
    border-left: 4px solid #ffc107;
    animation: slideDown 0.5s ease-out;
}

/* Print button animation */
.btn-primary[onclick*="print"] {
    position: relative;
    overflow: hidden;
}

.btn-primary[onclick*="print"]:hover::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    width: 300px;
    height: 300px;
}

/* Smooth page transitions */
.page-transition {
    animation: fadeInUp 0.6s ease-out;
}

/* Enhanced dropdown animations */
.dropdown-menu {
    animation: slideDown 0.3s ease-out;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Modal animations */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: translate(0, 0);
}

/* Tooltip animations */
.tooltip {
    animation: fadeIn 0.3s ease-out;
}

/* Progress bar animations */
.progress-bar {
    transition: width 0.6s ease;
}

/* Badge pulse effect */
.badge.bg-danger {
    animation: pulse 2s ease-in-out infinite;
}

/* Smooth number transitions */
.stat-number {
    font-variant-numeric: tabular-nums;
}

/* Enhanced button groups */
.btn-group .btn {
    transition: all var(--animation-duration) var(--animation-timing);
}

.btn-group .btn:hover {
    z-index: 1;
}

/* Search input enhancements */
.form-control[type="search"],
.form-control[placeholder*="Search"] {
    transition: all var(--animation-duration) var(--animation-timing);
}

.form-control[type="search"]:focus,
.form-control[placeholder*="Search"]:focus {
    transform: scale(1.01);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Select dropdown enhancements */
.form-select {
    cursor: pointer;
    transition: all var(--animation-duration) var(--animation-timing);
}

.form-select:hover {
    border-color: #667eea;
}

/* Textarea enhancements */
textarea.form-control {
    resize: vertical;
    transition: all var(--animation-duration) var(--animation-timing);
}

textarea.form-control:focus {
    transform: scale(1.01);
}

/* Link hover effects */
a:not(.btn):not(.nav-link) {
    transition: all var(--animation-duration) var(--animation-timing);
    text-decoration: none;
}

a:not(.btn):not(.nav-link):hover {
    text-decoration: underline;
    transform: translateX(2px);
}

/* Icon animations */
i[class^="bi-"] {
    transition: all var(--animation-duration) var(--animation-timing);
    display: inline-block;
}

.btn:hover i[class^="bi-"] {
    transform: scale(1.2);
}

/* Loading state for buttons */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 0.5em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

/* Smooth transitions for all cards */
.card-header {
    transition: background-color var(--animation-duration) var(--animation-timing);
}

.card:hover .card-header {
    background-color: rgba(0, 0, 0, 0.03);
}

/* Table pagination animations */
.pagination .page-link {
    transition: all var(--animation-duration) var(--animation-timing);
}

.pagination .page-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Enhanced border animations */
.border {
    transition: border-color var(--animation-duration) var(--animation-timing);
}

.border:hover {
    border-color: #667eea !important;
}

/* Smooth opacity transitions */
.opacity-50 {
    transition: opacity var(--animation-duration) var(--animation-timing);
}

.card:hover .opacity-50 {
    opacity: 0.7 !important;
}

/* Professional gradient backgrounds */
.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.bg-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
}

.bg-info {
    background: linear-gradient(135deg, #3494e6 0%, #ec6ead 100%) !important;
}

.bg-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.bg-danger {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%) !important;
}
