/* Quelist Invoice Management Styles */

/* ============================================
   CORPORATE LANDING PAGE STYLES
   ============================================ */

/* Root Variables for Corporate Theme */
:root {
    --corporate-primary: #1f4e79;
    --corporate-secondary: #2c5f84;
    --corporate-accent: #3b82f6;
    --corporate-light: #f8fafc;
    --corporate-dark: #1e293b;
    --corporate-text: #475569;
    --corporate-gradient: linear-gradient(135deg, var(--corporate-primary) 0%, var(--corporate-secondary) 100%);
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 10px 25px rgba(0, 0, 0, 0.15);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 76px; /* Height of the fixed header */
    --footer-height: 100px; /* Approximate height of the footer */
}

/* Body and Typography */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--corporate-text);
    background-color: #ffffff;
    padding-top: var(--header-height); /* Add padding for fixed header */
    padding-bottom: var(--footer-height); /* Add padding for fixed footer */
}

/* Corporate Navigation Header */
.corporate-header {
    background: var(--corporate-gradient);
    box-shadow: var(--shadow-medium);
    padding: 0.75rem 0;
    z-index: 1000;
    height: var(--header-height);
}

.navbar-brand {
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.navbar-brand:hover {
    transform: translateY(-1px);
}

.brand-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.brand-icon i {
    font-size: 1.5rem;
    color: white;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    border-radius: 8px;
    transition: var(--transition-smooth);
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white !important;
    transform: translateY(-1px);
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-heavy);
    border-radius: 12px;
    padding: 0.75rem 0;
    min-width: 200px;
}

.dropdown-item {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.dropdown-item:hover {
    background-color: var(--corporate-light);
    color: var(--corporate-primary);
    transform: translateX(5px);
}

/* Fixed Layout Adjustments */
/* Ensure the first section after header has proper spacing */
body > section:first-of-type,
body > .container:first-of-type,
main {
    margin-top: 1rem; /* Additional spacing for visual separation */
}

/* Hero Section */
.hero-section {
    padding-top: 120px;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23e2e8f0" stroke-width="1" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

.welcome-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, var(--corporate-primary), var(--corporate-secondary));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-medium);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--corporate-dark);
    line-height: 1.2;
    margin-bottom: 2rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--corporate-text);
    font-weight: 400;
    line-height: 1.6;
    max-width: 600px;
}

.hero-actions .btn {
    font-weight: 600;
    border-radius: 12px;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-medium);
}

.hero-actions .btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

.hero-graphic {
    position: relative;
    z-index: 2;
}

.graphic-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
}

.graphic-backdrop {
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--corporate-gradient);
    border-radius: 50%;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.graphic-content {
    position: relative;
    z-index: 2;
    width: 200px;
    height: 200px;
    background: var(--corporate-gradient);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-heavy);
    animation: float 6s ease-in-out infinite reverse;
}

.graphic-content i {
    font-size: 4rem;
    color: white;
}

/* Stats Section */
.stats-section {
    background-color: var(--corporate-light);
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: var(--transition-smooth);
    border: 1px solid #e2e8f0;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--corporate-dark);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--corporate-text);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

/* Features Section */
.features-section {
    padding: 5rem 0;
    background: white;
}

.section-header {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--corporate-dark);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

.feature-card {
    background: white;
    border-radius: 20px;
    padding: 3rem 2rem;
    transition: var(--transition-smooth);
    border: 1px solid #f1f5f9;
    box-shadow: var(--shadow-light);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--corporate-accent);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--corporate-accent) 0%, #60a5fa 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: var(--shadow-medium);
}

.feature-icon i {
    font-size: 2rem;
    color: white;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--corporate-dark);
    margin-bottom: 1rem;
}

.feature-description {
    color: var(--corporate-text);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Quick Actions Section */
.quick-actions-section {
    background: var(--corporate-gradient);
    position: relative;
    overflow: hidden;
}

.quick-actions-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="white" opacity="0.1"/><circle cx="20" cy="20" r="1" fill="white" opacity="0.1"/><circle cx="80" cy="30" r="1.5" fill="white" opacity="0.1"/><circle cx="30" cy="80" r="1" fill="white" opacity="0.1"/><circle cx="70" cy="70" r="2" fill="white" opacity="0.1"/></svg>') repeat;
    opacity: 0.3;
}

.quick-actions-section .container {
    position: relative;
    z-index: 2;
}

.quick-actions-section h2 {
    font-weight: 700;
    margin-bottom: 1rem;
}

.quick-actions-section .btn {
    font-weight: 600;
    border-radius: 12px;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-medium);
    border-width: 2px;
}

.quick-actions-section .btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

/* Footer Section */
.footer-section {
    background-color: var(--corporate-dark) !important;
    border-top: 1px solid #334155;
    height: var(--footer-height);
}

.footer-brand {
    text-decoration: none;
}

.footer-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-icon i {
    color: var(--corporate-accent);
    font-size: 1.25rem;
}

.footer-brand h6 {
    color: white;
    font-weight: 700;
    margin-bottom: 0;
}

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

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .graphic-container {
        height: 350px;
    }
}

@media (max-width: 992px) {
    .hero-section {
        padding-top: 100px;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        margin: 0 auto 2rem;
    }
    
    .graphic-container {
        height: 300px;
        margin-top: 3rem;
    }
    
    .feature-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 66px; /* Smaller header on mobile */
        --footer-height: 120px; /* Footer might be taller on mobile */
    }
    
    body {
        padding-top: var(--header-height);
        padding-bottom: var(--footer-height);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .stat-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .features-section {
        padding: 3rem 0;
    }
    
    .corporate-header {
        padding: 0.5rem 0;
        height: var(--header-height);
    }
    
    .brand-icon {
        width: 40px;
        height: 40px;
    }
    
    .brand-name {
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    :root {
        --header-height: 60px; /* Even smaller header on small mobile */
    }
    
    body {
        padding-top: var(--header-height);
    }
    
    .hero-section {
        padding-top: 90px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .welcome-badge {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero-actions .btn {
        margin-bottom: 0.75rem;
    }
    
    .feature-card {
        padding: 1.5rem 1rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-icon i {
        font-size: 1.5rem;
    }
    
    .graphic-backdrop,
    .graphic-content {
        width: 200px;
        height: 200px;
    }
    
    .graphic-content i {
        font-size: 2.5rem;
    }
}

/* ============================================
   EXISTING APPLICATION STYLES
   ============================================ */

/* Status Badge Styling */
.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.375rem 0.75rem;
}

/* Table Enhancements */
.table-responsive {
    border: 1px solid var(--bs-border-color);
}

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

.table > thead > tr > th {
    border-bottom: 2px solid var(--bs-border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
}

/* Button Group Enhancements */
.btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Modal Enhancements */
.modal-header {
    background-color: var(--bs-light);
    border-bottom: 1px solid var(--bs-border-color);
}

.modal-title {
    font-weight: 600;
    color: var(--bs-dark);
}

.modal-footer {
    border-top: 1px solid var(--bs-border-color);
    background-color: var(--bs-light);
}

/* Special styling for delete modal */
.modal-header.bg-danger {
    background-color: var(--bs-danger) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header.bg-danger .modal-title {
    color: white !important;
}

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

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

/* Form Enhancements */
.form-label {
    font-weight: 600;
    color: var(--bs-dark);
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Empty State Styling */
.empty-state {
    padding: 3rem 0;
}

/* Loading States */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Alert Enhancements */
.alert {
    border: none;
    border-radius: 0.5rem;
    border-left: 4px solid transparent;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--bs-success);
    border-left-color: var(--bs-success);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--bs-danger);
    border-left-color: var(--bs-danger);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--bs-warning);
    border-left-color: var(--bs-warning);
}

.alert-info {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--bs-info);
    border-left-color: var(--bs-info);
}

/* Alert dismiss button styling */
.alert-dismissible .btn-close {
    position: relative;
    top: 0;
    right: 0;
    z-index: 2;
    padding: 0.375rem;
}

.alert-dismissible .btn-close:hover {
    opacity: 0.75;
}

.alert.fade.show {
    animation: slideInFromTop 0.3s ease-out;
}

/* Enhanced alert animations */
.alert {
    animation: slideInFromTop 0.3s ease-out;
}

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

/* Card Enhancements */
.card {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Avatar Styling for Clients */
.avatar-sm {
    width: 40px;
    height: 40px;
    font-size: 0.875rem;
    font-weight: 600;
}

.avatar-lg {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Avatar Placeholder for Client Table */
.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(13, 110, 253, 0.1);
    border: 2px solid rgba(13, 110, 253, 0.2);
    transition: all 0.2s ease-in-out;
}

.avatar-placeholder i {
    color: var(--bs-primary);
}

.avatar-placeholder:hover {
    background-color: rgba(13, 110, 253, 0.15);
    border-color: rgba(13, 110, 253, 0.3);
    transform: scale(1.05);
}

/* Client Table Enhancements */
.table tbody tr {
    transition: all 0.2s ease-in-out;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Clickable Table Rows */
.table-row-clickable {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.table-row-clickable:hover {
    background-color: rgba(13, 110, 253, 0.08) !important;
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
}

.table-row-clickable:active {
    transform: translateY(0);
    background-color: rgba(13, 110, 253, 0.12) !important;
    transition: all 0.1s ease-in-out;
}

/* Prevent edit button click from triggering row click */
.table-row-clickable .btn-group {
    position: relative;
    z-index: 10;
}

/* Search and Filter Bar */
.card-body .input-group-text {
    background-color: var(--bs-light);
    border-color: var(--bs-border-color);
    color: var(--bs-secondary);
}

/* Client Details Modal */
.client-details-header {
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-primary-dark, #0b5ed7));
    color: white;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 1.5rem;
    margin: -1rem -1rem 1rem -1rem;
}

/* Action Buttons */
.btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(13, 110, 253, 0.25);
}

.btn-outline-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(108, 117, 125, 0.25);
}

.btn-outline-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(220, 53, 69, 0.25);
}

/* Enhanced action button group */
.btn-group .btn {
    position: relative;
    z-index: 1;
}

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

.btn-group .btn:focus,
.btn-group .btn:active {
    z-index: 3;
}

/* Toast Enhancements */
.toast-container {
    z-index: 1080;
}

.toast {
    min-width: 300px;
}

/* Loading State for Modal */
.modal.loading {
    pointer-events: none;
}

.modal.loading .modal-content {
    opacity: 0.7;
}

/* Form Validation Enhancements */
.form-control.is-invalid {
    border-color: var(--bs-danger);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid {
    border-color: var(--bs-success);
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* Client Count Badge */
.badge {
    font-size: 0.75em;
    border-radius: 0.375rem;
}

/* Client Name Display */
.client-name {
    font-weight: 600;
    color: var(--bs-dark);
    text-decoration: none;
}

.client-name:hover {
    color: var(--bs-primary);
    text-decoration: underline;
}

/* Contact Links Styling */
.contact-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

.contact-link:hover {
    color: var(--bs-primary) !important;
    text-decoration: none;
}

/* Header Section Enhancement */
.page-header {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-dark, #0b5ed7) 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 0.25rem 0.75rem rgba(13, 110, 253, 0.2);
}

.page-header h2 {
    margin-bottom: 0.25rem;
}

.page-header .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.9rem;
}

/* Delete confirmation styling */
.delete-confirmation {
    text-align: center;
    padding: 1rem 0;
}

.delete-confirmation .fa-exclamation-triangle {
    animation: pulse 1.5s infinite;
}

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

/* Modal backdrop enhancement */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.6);
}

/* Enhanced modal form styling */
.modal-body .row.g-3 {
    margin: 0;
}

.modal-body .row.g-3 > [class*="col-"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Modal footer button styling */
.modal-footer .btn {
    min-width: 100px;
    font-weight: 500;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-dark, #0b5ed7) 100%);
    border: none;
}

.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, var(--bs-primary-dark, #0b5ed7) 0%, var(--bs-primary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(13, 110, 253, 0.3);
}

/* Delete modal specific styling */
#deleteClientModal .modal-content,
#deleteInvoiceModal .modal-content,
#deleteProductModal .modal-content {
    border: 2px solid var(--bs-danger);
    box-shadow: 0 0.5rem 1rem rgba(220, 53, 69, 0.2);
}

#deleteClientModal .modal-body,
#deleteInvoiceModal .modal-body,
#deleteProductModal .modal-body {
    padding: 2rem 1.5rem;
}

#deleteClientModal .fa-exclamation-triangle,
#deleteInvoiceModal .fa-exclamation-triangle,
#deleteProductModal .fa-exclamation-triangle {
    color: var(--bs-danger);
    margin-bottom: 1rem;
}

/* Add/Edit modal styling */
#addClientModal .modal-content,
#editClientModal .modal-content,
#addInvoiceModal .modal-content,
#editInvoiceModal .modal-content,
#addProductModal .modal-content,
#editProductModal .modal-content {
    border: none;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
}

#addClientModal .modal-header,
#editClientModal .modal-header,
#addInvoiceModal .modal-header,
#editInvoiceModal .modal-header,
#addProductModal .modal-header,
#editProductModal .modal-header {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-dark, #0b5ed7) 100%);
    color: white;
    border-bottom: none;
}

#addClientModal .modal-title,
#editClientModal .modal-title,
#addInvoiceModal .modal-title,
#editInvoiceModal .modal-title,
#addProductModal .modal-title,
#editProductModal .modal-title {
    color: white;
}

/* Form input focus effects in modals */
.modal .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    background-color: rgba(13, 110, 253, 0.02);
}

/* Modal loading state improvements */
.modal .btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.modal .spinner-border-sm {
    animation: spinner-border 0.75s linear infinite;
}

/* Success state in modals */
.modal .alert-success {
    margin-bottom: 0;
    border-radius: 0.375rem;
    background-color: rgba(25, 135, 84, 0.15);
    border-left: 4px solid var(--bs-success);
}

/* Error state in modals */
.modal .alert-danger {
    margin-bottom: 0;
    border-radius: 0.375rem;
    background-color: rgba(220, 53, 69, 0.15);
    border-left: 4px solid var(--bs-danger);
}

/* Required field indicator */
.form-label .required {
    color: var(--bs-danger);
    margin-left: 0.25rem;
}

.form-label .required:before {
    content: "*";
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .table-responsive table,
    .table-responsive thead,
    .table-responsive tbody,
    .table-responsive th,
    .table-responsive td,
    .table-responsive tr {
        display: block;
    }
    
    .table-responsive thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .table-responsive tr {
        border: 1px solid var(--bs-border-color);
        margin-bottom: 1rem;
        border-radius: 0.5rem;
        padding: 1rem;
        background-color: white;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
    
    .table-responsive td {
        border: none;
        position: relative;
        padding: 0.5rem 0 0.5rem 50%;
        text-align: left;
    }
    
    .table-responsive td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: var(--bs-dark);
    }
    
    .btn-group {
        display: flex;
        flex-direction: row;
        gap: 0.25rem;
        justify-content: flex-end;
    }
    
    .btn-group > .btn {
        border-radius: 0.375rem !important;
        margin: 0;
        flex: 0 0 auto;
    }
    
    /* Mobile Modal Adjustments */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-lg,
    .modal-xl {
        max-width: calc(100vw - 1rem);
    }
    
    /* Mobile Form Adjustments */
    .row.g-3 > .col-md-6,
    .row.g-3 > .col-md-3 {
        margin-bottom: 1rem;
    }
    
    /* Mobile modal form adjustments */
    .modal-body .row.g-3 > [class*="col-"] {
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 1rem;
    }
    
    .modal-footer {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Mobile header adjustments */
    .page-header {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .page-header h2 {
        font-size: 1.5rem;
    }
}

/* Small Screen Optimizations */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .modal-header .modal-title {
        font-size: 1.1rem;
    }
    
    .avatar-sm,
    .avatar-placeholder {
        width: 35px;
        height: 35px;
        font-size: 0.75rem;
    }
    
    .btn-group .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .empty-state {
        padding: 2rem 0;
    }
    
    .empty-state .fa-users {
        font-size: 2rem !important;
    }
    
    /* Small screen modal adjustments */
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
    }
    
    #deleteClientModal .modal-body,
    #deleteInvoiceModal .modal-body,
    #deleteProductModal .modal-body {
        padding: 1.5rem 1rem;
    }
}

/* Print Styles */
@media print {
    .btn, .modal, .alert, .toast-container {
        display: none !important;
    }
    
    .table {
        border-collapse: collapse;
    }
    
    .table th,
    .table td {
        border: 1px solid #000;
        padding: 0.5rem;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .page-header {
        background: none !important;
        color: #000 !important;
        border: 1px solid #000;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .table-light {
        background-color: var(--bs-dark);
        color: var(--bs-light);
    }
    
    .modal-header,
    .modal-footer {
        background-color: var(--bs-dark);
        border-color: var(--bs-border-color-translucent);
    }
    
    .avatar-sm,
    .avatar-lg,
    .avatar-placeholder {
        background-color: var(--bs-primary-dark, #0b5ed7) !important;
    }
    
    .page-header {
        background: linear-gradient(135deg, var(--bs-primary-dark, #0b5ed7) 0%, var(--bs-primary) 100%) !important;
    }
    
    /* Dark mode modal adjustments */
    #addClientModal .modal-header,
    #editClientModal .modal-header,
    #addInvoiceModal .modal-header,
    #editInvoiceModal .modal-header,
    #addProductModal .modal-header,
    #editProductModal .modal-header {
        background: linear-gradient(135deg, var(--bs-primary-dark, #0b5ed7) 0%, var(--bs-primary) 100%);
    }
}

/* ============================================
   PRODUCT MANAGEMENT SPECIFIC STYLES
   ============================================ */

/* Product Card Enhancements */
.product-card {
    background: white;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
    border-color: var(--corporate-accent);
}

.product-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--corporate-accent) 0%, #60a5fa 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-medium);
}

.product-icon i {
    font-size: 1.5rem;
    color: white;
}

.product-name {
    font-weight: 700;
    color: var(--corporate-dark);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.product-description {
    color: var(--corporate-text);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    height: 3em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--corporate-primary);
    margin-bottom: 1rem;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--corporate-text);
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
    margin-top: 1rem;
}

/* Product Table Enhancements - Clickable Rows */
.products-table .table tbody tr {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.products-table .table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.08) !important;
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
}

.products-table .table tbody tr:active {
    transform: translateY(0);
    background-color: rgba(13, 110, 253, 0.12) !important;
    transition: all 0.1s ease-in-out;
}

/* Prevent action button clicks from triggering row click */
.products-table .table tbody tr .btn-group {
    position: relative;
    z-index: 10;
}

.products-table .table th {
    background-color: var(--corporate-primary);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
    padding: 1rem 0.75rem;
}

.products-table .table td {
    vertical-align: middle;
    padding: 1rem 0.75rem;
    border-color: var(--bs-border-color);
}

/* Product Status Badges */
.product-status-badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-status-badge.in-stock {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--bs-success);
    border: 1px solid rgba(25, 135, 84, 0.3);
}

.product-status-badge.low-stock {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--bs-warning);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.product-status-badge.out-of-stock {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--bs-danger);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Product Price Styling */
.product-price-display {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--corporate-primary);
    font-size: 1.1rem;
}

/* Product Search and Filter Enhancements */
.product-filters {
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.03) 0%, rgba(var(--bs-primary-rgb), 0.01) 100%);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.1);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    background: var(--corporate-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-right: 1rem;
    box-shadow: var(--shadow-medium);
}

.filter-badge i {
    margin-right: 0.5rem;
}

/* Product Grid Layout */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.product-grid-item {
    background: white;
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

.product-grid-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--corporate-accent);
}

.product-image {
    height: 200px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--bs-border-color);
}

.product-image i {
    font-size: 3rem;
    color: var(--corporate-text);
    opacity: 0.3;
}

.product-info {
    padding: 1.5rem;
}

/* Product Modal Enhancements */
.product-info-section {
    background: linear-gradient(135deg, rgba(var(--bs-success-rgb), 0.05) 0%, rgba(var(--bs-success-rgb), 0.02) 100%);
    border: 1px solid rgba(var(--bs-success-rgb), 0.1);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.product-info-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(var(--bs-success-rgb), 0.1);
}

.product-info-header h6 {
    color: var(--bs-success);
    font-weight: 600;
    margin-bottom: 0;
}

.product-info-header i {
    color: var(--bs-success);
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

/* Product Deletion Confirmation */
.product-summary-card {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 50%, #fff5f5 100%);
    border: 2px solid var(--bs-danger);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 0.25rem 0.75rem rgba(220, 53, 69, 0.15);
}

.product-summary-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(220, 53, 69, 0.2);
}

.product-summary-header h6 {
    color: var(--bs-danger);
    font-weight: 600;
    margin-bottom: 0;
}

.product-summary-header i {
    color: var(--bs-danger);
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

/* Empty Product State */
.products-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 1rem;
    border: 2px dashed #cbd5e1;
}

.products-empty-state i {
    font-size: 4rem;
    color: var(--corporate-text);
    opacity: 0.3;
    margin-bottom: 2rem;
}

.products-empty-state h4 {
    color: var(--corporate-dark);
    margin-bottom: 1rem;
}

.products-empty-state p {
    color: var(--corporate-text);
    font-size: 1.1rem;
    max-width: 400px;
    margin: 0 auto 2rem;
}

/* Product Count Badge */
.product-count-badge {
    background: var(--corporate-gradient);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 700;
    box-shadow: var(--shadow-medium);
    border: none;
}

/* Product Action Buttons */
.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.product-actions .btn {
    flex: 1;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.product-actions .btn-edit {
    background: linear-gradient(135deg, var(--bs-info) 0%, #54a3ff 100%);
    border: none;
    color: white;
}

.product-actions .btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.75rem rgba(var(--bs-info-rgb), 0.4);
}

.product-actions .btn-delete {
    background: linear-gradient(135deg, var(--bs-danger) 0%, #ff5757 100%);
    border: none;
    color: white;
}

.product-actions .btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.75rem rgba(var(--bs-danger-rgb), 0.4);
}

/* Product Form Enhancements */
.product-form-section {
    background: white;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: var(--shadow-light);
}

.product-form-header {
    background: var(--corporate-gradient);
    color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: -2rem -2rem 2rem -2rem;
}

.product-form-header h5 {
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.product-form-header p {
    margin-bottom: 0;
    opacity: 0.9;
}

/* Responsive Product Enhancements */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-card {
        padding: 1rem;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-image i {
        font-size: 2rem;
    }
    
    .products-empty-state {
        padding: 2rem 1rem;
    }
    
    .products-empty-state i {
        font-size: 3rem;
    }
    
    /* Mobile table rows become clickable cards */
    .table-responsive tr {
        cursor: pointer;
        transition: all 0.2s ease-in-out;
    }
    
    .table-responsive tr:hover {
        transform: translateY(-2px);
        box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
        border-color: var(--bs-primary);
    }
    
    .table-responsive tr:active {
        transform: translateY(0);
        background-color: rgba(13, 110, 253, 0.05);
    }
}

/* Animation Enhancements */
.table tbody tr {
    transition: all 0.2s ease-in-out;
}

.btn {
    transition: all 0.15s ease-in-out;
}

.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
}

.card {
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Focus and Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Custom Badge Colors */
.badge.bg-secondary {
    background-color: #6c757d !important;
}

.badge.bg-primary {
    background-color: #0d6efd !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

/* Utility Classes */
.fw-medium {
    font-weight: 500;
}

.text-muted {
    color: var(--bs-secondary) !important;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Error State Styling */
.error-state {
    text-align: center;
    padding: 2rem;
    color: var(--bs-danger);
}

/* Success State Styling */
.success-state {
    text-align: center;
    padding: 2rem;
    color: var(--bs-success);
}

/* Product-specific styles */
.product-card {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Search highlight */
.search-highlight {
    background-color: rgba(255, 193, 7, 0.3);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

/* Responsive table labels for mobile */
.table-responsive td[data-label]:before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--bs-primary);
}

/* Form floating labels */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Modal content transitions */
.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
}

/* Loading spinner in modals */
.modal .spinner-border-sm {
    width: 0.875rem;
    height: 0.875rem;
}

/* Enhanced form group spacing */
.form-group.mb-3 {
    margin-bottom: 1.5rem !important;
}

/* Last form group in modal body */
.modal-body .form-group:last-child {
    margin-bottom: 0 !important;
}

/* Success/Error icon styling */
.alert .fas {
    margin-right: 0.5rem;
}

/* Table action buttons styling */
.table .btn-group .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    line-height: 1.2;
}

.table .btn-group .btn i {
    font-size: 0.875rem;
}