body { font-family: Arial, sans-serif; }

/* === FONT SPECIFICATIONS FOR QUOTATION AND INVOICE === */

/* Quotation Section - Arial Black Fonts for Headers */
#quotation-print-area .quotation-details-header strong,
#quotation-print-area .quotation-details-header p strong,
#quotation-print-area .quotation-details-header p.font-bold,
#quotation-print-area #quotation-customer-name,
#quotation-print-area #quotation-date-display,
#quotation-print-area .invoice-items-table thead th {
    font-family: 'Arial Black', Arial, sans-serif !important;
    font-weight: 900 !important;
}

/* Quotation Section - Bookman Old Style for Table Body Only */
#quotation-print-area .invoice-items-table tbody td {
    font-family: 'Bookman Old Style', serif !important;
    font-weight: 580 !important;
}

/* Keep Net Total unchanged */
#quotation-print-area #quotation-template-total {
    font-family: 'Bookman Old Style', serif !important;
    font-weight: 700 !important;
}

/* Invoice Section - Arial Black Fonts for Headers (excluding Net Total) */
#invoice-print-area strong:not(#invoice-template-total),
#invoice-print-area .invoice-payment-info p.font-bold,
#invoice-print-area #invoice-template-no,
#invoice-print-area #invoice-template-date,
#invoice-print-area #invoice-template-to,
#invoice-print-area .invoice-items-table thead th {
    font-family: 'Arial Black', Arial, sans-serif !important;
    font-weight: 900 !important;
}

/* Invoice Section - Bookman Old Style for Table Body Only */
#invoice-print-area .invoice-items-table tbody td {
    font-family: 'Bookman Old Style', serif !important;
    font-weight: 580 !important;
}

/* Keep Net Total and Payment Info unchanged */
#invoice-print-area #invoice-template-total,
#invoice-print-area .invoice-payment-info .font-bold.mt-4,
#invoice-print-area .invoice-payment-info .font-bold.mt-4 strong,
#invoice-print-area .invoice-payment-info .font-bold.mt-4 span {
    font-family: 'Bookman Old Style', serif !important;
    font-weight: 700 !important;
}

/* Quotation Total Section - Dark Background with Bookman Old Style Regular */
#quotation-print-area [class*="bg-"][class*="393938"] strong,
#quotation-print-area [class*="bg-"][class*="393938"] span {
    font-family: 'Bookman Old Style', serif !important;
    font-weight: 700 !important;
}

/* Additional specific font styling for quotation elements */
#quotation-customer-name {
    font-family: 'Arial Black', Arial, sans-serif !important;
    font-weight: 900 !important;
}

#quotation-template-total {
    font-family: 'Bookman Old Style', serif !important;
    font-weight: 700 !important;
}

/* Additional specific font styling for invoice elements */
#invoice-template-total {
    font-family: 'Bookman Old Style', serif !important;
    font-weight: 700 !important;
}

/* Force Invoice Net Total to override any inherited styles */
#invoice-print-area #invoice-template-total {
    font-family: 'Bookman Old Style', serif !important;
    font-weight: 700 !important;
}

/* Override Tailwind classes for Invoice Net Total */
span#invoice-template-total.text-lg.font-bold {
    font-family: 'Bookman Old Style', serif !important;
    font-weight: 700 !important;
}

/* Most specific rule for Invoice Net Total with all possible selectors */
#invoice-print-area div.bg-\[393938\] span#invoice-template-total {
    font-family: 'Bookman Old Style', serif !important;
    font-weight: 700 !important;
}

/* Alternative approach - target by class structure */
.bg-\[393938\] .text-\[f0b21b\]#invoice-template-total {
    font-family: 'Bookman Old Style', serif !important;
    font-weight: 700 !important;
}

/* Table Cell Data Alignment for Quotation and Invoice */
#quotation-print-area .invoice-items-table tbody td:nth-child(1), /* NO */
#quotation-print-area .invoice-items-table tbody td:nth-child(3), /* QTY */
#quotation-print-area .invoice-items-table tbody td:nth-child(4), /* SQFT */
#invoice-print-area .invoice-items-table tbody td:nth-child(1), /* NO */
#invoice-print-area .invoice-items-table tbody td:nth-child(3), /* QTY */
#invoice-print-area .invoice-items-table tbody td:nth-child(4) { /* SQFT */
    text-align: center !important;
}

#quotation-print-area .invoice-items-table tbody td:nth-child(5), /* PRICE */
#quotation-print-area .invoice-items-table tbody td:nth-child(6), /* TOTAL */
#invoice-print-area .invoice-items-table tbody td:nth-child(5), /* PRICE */
#invoice-print-area .invoice-items-table tbody td:nth-child(6) { /* TOTAL */
    text-align: right !important;
    padding-right: 8px !important;
}

#quotation-print-area .invoice-items-table tbody td:nth-child(2), /* DESCRIPTION */
#invoice-print-area .invoice-items-table tbody td:nth-child(2) { /* DESCRIPTION */
    text-align: left !important;
    padding-left: 8px !important;
}

/* Table Header Center Alignment for Quotation and Invoice */
#quotation-print-area .invoice-items-table thead th,
#invoice-print-area .invoice-items-table thead th {
    text-align: center !important;
}

/* === END FONT SPECIFICATIONS === */

.customer-records-sub-content { display: none; }
.customer-records-sub-content.active { display: block; }
.modal { display: none; }
.modal.active { display: flex; }
.stock-sub-content { display: none; }
.stock-sub-content.active { display: block; }
.tab-content, .nav-link { display: none; }
.tab-content.active, .nav-link.visible { display: block; }
.nav-link.active { background-color: #1D4ED8; color: white; }
#calendar .day { cursor: pointer; }
#calendar .day.has-orders { background-color: #BFDBFE; font-weight: bold; }
#calendar .day.selected { background-color: #1D4ED8; color: white; }

@media print {
    /* --- General Print Rules --- */
    .no-print {
        display: none !important;
        visibility: hidden !important;
    }

    @page {
        margin: 1.5cm;
        size: A4;
    }

    /* --- Scoped Print Styles --- */

    /* Hide everything by default when a print scope is active */
    body.printing-invoice *,
    body.printing-quotation *,
    body.printing-daily-report * {
        visibility: hidden !important;
    }

    /* --- Invoice Print Styles --- */
    body.printing-invoice #invoice-print-area,
    body.printing-invoice #invoice-print-area * {
        visibility: visible !important;
    }
    body.printing-invoice #invoice-print-area {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }

    /* --- Quotation Print Styles --- */
    body.printing-quotation #quotation-print-area,
    body.printing-quotation #quotation-print-area * {
        visibility: visible !important;
    }
    body.printing-quotation #quotation-print-area {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }

    /* --- Daily Report Print Styles --- */
    body.printing-daily-report #daily-report-content,
    body.printing-daily-report #daily-report-content * {
        visibility: visible !important;
    }
    body.printing-daily-report #daily-report-content {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
}

/* General styles for responsive layout */
.table-container {
    max-width: 100%;
    overflow-x: auto;
}

.invoice-items-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.invoice-items-table th,
.invoice-items-table td {
    padding: 8px 4px;
    text-align: left;
    border: 1px solid #ddd;
    white-space: nowrap;
}

/* Override default left alignment for specific columns */
.invoice-items-table td:nth-child(1), /* NO */
.invoice-items-table td:nth-child(3), /* QTY */
.invoice-items-table td:nth-child(4) { /* SQFT */
    text-align: center;
}

.invoice-items-table td:nth-child(5), /* PRICE */
.invoice-items-table td:nth-child(6) { /* TOTAL */
    text-align: right;
    padding-right: 8px;
}

.invoice-items-table td:nth-child(2) { /* DESCRIPTION */
    text-align: left;
    padding-left: 8px;
}

.invoice-items-table th {
    background-color: #f0b21b;
    color: white;
    font-weight: bold;
}

.invoice-items-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.invoice-items-table tr:nth-child(odd) {
    background-color: #ffffff;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .invoice-items-table {
        min-width: 500px;
    }
    
    .invoice-items-table th,
    .invoice-items-table td {
        padding: 6px 3px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .invoice-items-table {
        min-width: 400px;
    }
    
    .invoice-items-table th,
    .invoice-items-table td {
        padding: 4px 2px;
        font-size: 11px;
    }
}

/* Quotation and Invoice specific styles */
.quotation-details-header {
    margin-bottom: 20px;
}

.quotation-details-header .text-xl {
    font-size: 1.25rem;
}

/* Income sub content styles */
.income-sub-content { display: none; }
.income-sub-content.active { display: block; }

/* Quotation sub content styles */
.quotation-sub-content { display: none; }
.quotation-sub-content.active { display: block; }

/* Sub navigation button styles */
.sub-nav-btn {
    cursor: pointer;
    transition: all 0.3s ease;
}

.sub-nav-btn.active {
    border-bottom: 2px solid #2563eb;
    color: #2563eb;
}

/* Stock summary styles */
#stock-item-tabs {
    min-height: 50px;
}

/* Dashboard card styles */
.dashboard-card {
    transition: transform 0.2s ease-in-out;
}

.dashboard-card:hover {
    transform: translateY(-2px);
}

/* Form validation styles */
.form-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success styles */
.form-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 1px #10b981 !important;
}

.success-message {
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Modal styles */
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

/* Export specific styles for quotation */
#quotation-print-area.is-exporting {
    position: relative !important;
    background: white !important;
    padding: 20px !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

#quotation-print-area.is-exporting .table-container {
    overflow: visible !important;
}

#quotation-print-area.is-exporting table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 20px 0 !important;
}

#quotation-print-area.is-exporting th {
    padding: 12px 8px !important;
    text-align: center !important;
    font-weight: bold !important;
    color: white !important;
    border: 1px solid #ddd !important;
    vertical-align: middle !important;
}

/* Default theme header background */
#quotation-print-area.is-exporting th {
    background-color: #f0b21b !important;
    background: #f0b21b !important;
    background-image: linear-gradient(to bottom, #f0b21b, #f0b21b) !important;
    box-shadow: inset 0 0 0 1000px #f0b21b !important;
}

/* Night theme header background */
[data-theme="night"] #quotation-print-area.is-exporting th {
    background-color: #374151 !important;
    background: #374151 !important;
    background-image: linear-gradient(to bottom, #374151, #374151) !important;
    box-shadow: inset 0 0 0 1000px #374151 !important;
}

[data-theme="orange"] #quotation-print-area.is-exporting th {
    background-color: #EA580C !important;
    background: #EA580C !important;
    background-image: linear-gradient(to bottom, #EA580C, #EA580C) !important;
    box-shadow: inset 0 0 0 1000px #EA580C !important;
}

[data-theme="custom"] #quotation-print-area.is-exporting th {
    background-color: #8B5CF6 !important;
    background: #8B5CF6 !important;
    background-image: linear-gradient(to bottom, #8B5CF6, #8B5CF6) !important;
    box-shadow: inset 0 0 0 1000px #8B5CF6 !important;
}

/* Table data cells */
#quotation-print-area.is-exporting td {
    padding: 10px 8px !important;
    border: 1px solid #ddd !important;
    vertical-align: middle !important;
}

#quotation-print-area.is-exporting td.text-right {
    text-align: right !important;
}

#quotation-print-area.is-exporting td.text-center {
    text-align: center !important;
}

/* Export specific data alignment for quotation table */
#quotation-print-area.is-exporting td:nth-child(1), /* NO */
#quotation-print-area.is-exporting td:nth-child(3), /* QTY */
#quotation-print-area.is-exporting td:nth-child(4) { /* SQFT */
    text-align: center !important;
}

#quotation-print-area.is-exporting td:nth-child(5), /* PRICE */
#quotation-print-area.is-exporting td:nth-child(6) { /* TOTAL */
    text-align: right !important;
    padding-right: 8px !important;
}

#quotation-print-area.is-exporting td:nth-child(2) { /* DESCRIPTION */
    text-align: left !important;
    padding-left: 12px !important;
}

/* Fix signature section spacing */
#quotation-print-area.is-exporting .text-right:last-child {
    margin-top: 30px !important;
    margin-bottom: 0 !important;
}

/* Keep normal positioning for signature elements */
#quotation-print-area.is-exporting .text-right img,
#quotation-print-area.is-exporting .text-right div {
    position: relative !important;
    display: inline-block !important;
    margin: 5px 0 !important;
}

/* Set the text color for the editable customer name on the quotation form */
#quotation-customer-name {
    color: #ff9500;
    font-weight: bold;
}

/* Customer name styling for Invoice */
#invoice-template-to {
    color: #ff9500;
    font-weight: bold;
}

/* Theme variations */
[data-theme="night"] {
    background-color: #1f2937;
    color: #f9fafb;
}

[data-theme="night"] .bg-white {
    background-color: #374151 !important;
    color: #f9fafb !important;
}

[data-theme="night"] .nav-link {
    color: #d1d5db;
}

[data-theme="night"] .nav-link.active {
    background-color: #4b5563;
    color: #f59e0b;
}

[data-theme="orange"] .nav-link.active {
    background-color: #ea580c;
    color: white;
}

[data-theme="custom"] .nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Loading spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    max-width: 400px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-in-out;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    background-color: #10b981;
}

.notification.error {
    background-color: #ef4444;
}

.notification.info {
    background-color: #3b82f6;
}

.notification.warning {
    background-color: #f59e0b;
}

/* Print optimizations */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.font-bold { font-weight: bold; }
.hidden { display: none; }
.block { display: block; }
.flex { display: flex; }
.grid { display: grid; }

/* Responsive grid classes */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 768px) {
    .md-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .lg-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Gap utilities */
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Padding utilities */
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

/* Margin utilities */
.m-2 { margin: 0.5rem; }
.m-4 { margin: 1rem; }
.m-6 { margin: 1.5rem; }
.m-8 { margin: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

/* Color utilities */
.text-blue-600 { color: #2563eb; }
.text-red-500 { color: #ef4444; }
.text-green-600 { color: #16a34a; }
.text-gray-500 { color: #6b7280; }
.text-gray-700 { color: #374151; }
.text-white { color: #ffffff; }

.bg-blue-600 { background-color: #2563eb; }
.bg-red-500 { background-color: #ef4444; }
.bg-green-600 { background-color: #16a34a; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-white { background-color: #ffffff; }

/* Border utilities */
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-gray-300 { border-color: #d1d5db; }
.border-blue-600 { border-color: #2563eb; }
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }

/* Shadow utilities */
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

/* Width utilities */
.w-full { width: 100%; }
.w-1-2 { width: 50%; }
.w-1-3 { width: 33.333333%; }
.w-2-3 { width: 66.666667%; }
.w-1-4 { width: 25%; }
.w-3-4 { width: 75%; }

/* Height utilities */
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.min-h-screen { min-height: 100vh; }

/* Flexbox utilities */
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

/* Position utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* Z-index utilities */
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }
.z-1000 { z-index: 1000; }

/* Overflow utilities */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Transition utilities */
.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }
.ease-in-out { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }

/* Hover utilities */
.hover-bg-blue-700:hover { background-color: #1d4ed8; }
.hover-bg-red-600:hover { background-color: #dc2626; }
.hover-bg-green-700:hover { background-color: #15803d; }
.hover-bg-gray-50:hover { background-color: #f9fafb; }

/* Focus utilities */
.focus-outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus-ring-2:focus { box-shadow: 0 0 0 2px #3b82f6; }
.focus-ring-blue-500:focus { box-shadow: 0 0 0 2px #3b82f6; }
.focus-border-blue-500:focus { border-color: #3b82f6; }

/* Responsive utilities */
@media (min-width: 640px) {
    .sm-text-sm { font-size: 0.875rem; line-height: 1.25rem; }
}

@media (min-width: 768px) {
    .md-flex-row { flex-direction: row; }
    .md-flex-col { flex-direction: column; }
    .md-w-auto { width: auto; }
    .md-w-1-2 { width: 50%; }
    .md-col-span-2 { grid-column: span 2 / span 2; }
    .md-col-span-3 { grid-column: span 3 / span 3; }
    .md-col-span-4 { grid-column: span 4 / span 4; }
}

@media (min-width: 1024px) {
    .lg-col-span-2 { grid-column: span 2 / span 2; }
    .lg-col-span-3 { grid-column: span 3 / span 3; }
    .lg-col-span-4 { grid-column: span 4 / span 4; }
    .lg-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Print-specific font overrides for better compatibility */
@media print {
    /* Fallback fonts for systems without Arial Black or Bookman Old Style */
    #quotation-print-area .quotation-details-header strong,
    #quotation-print-area .quotation-details-header p strong,
    #quotation-print-area #quotation-date-display,
    #quotation-print-area .invoice-items-table thead th,
    #invoice-print-area strong:not(#invoice-template-total),
    #invoice-print-area #invoice-template-no,
    #invoice-print-area #invoice-template-date,
    #invoice-print-area #invoice-template-to,
    #invoice-print-area .invoice-items-table thead th,
    #invoice-print-area .invoice-payment-info p.font-bold {
        font-family: 'Arial Black', 'Arial Bold', Arial, 'Helvetica Bold', Helvetica, sans-serif !important;
        font-weight: 900 !important;
    }
    
    /* Table body data with lighter weight */
    #quotation-print-area .invoice-items-table tbody td,
    #invoice-print-area .invoice-items-table tbody td {
        font-family: 'Bookman Old Style', 'Times New Roman', Times, serif !important;
        font-weight: 580 !important;
    }
    
    /* Keep Net Total and Payment Info bold */
    #quotation-print-area #quotation-template-total,
    #invoice-print-area #invoice-template-total,
    #invoice-print-area .invoice-payment-info .font-bold.mt-4,
    #invoice-print-area .invoice-payment-info .font-bold.mt-4 strong,
    #invoice-print-area .invoice-payment-info .font-bold.mt-4 span {
        font-family: 'Bookman Old Style', 'Times New Roman', Times, serif !important;
        font-weight: 700 !important;
    }
}

/* === EDITABLE INVOICE FIELDS STYLES === */
#invoice-template-no[contenteditable="true"],
#invoice-template-date[contenteditable="true"],
#invoice-template-to[contenteditable="true"] {
    cursor: text;
    padding: 2px 4px;
    border-radius: 3px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

#invoice-template-no[contenteditable="true"]:hover,
#invoice-template-date[contenteditable="true"]:hover,
#invoice-template-to[contenteditable="true"]:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

#invoice-template-no[contenteditable="true"]:focus,
#invoice-template-date[contenteditable="true"]:focus,
#invoice-template-to[contenteditable="true"]:focus {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6 !important;
}

/* Hide borders when printing */
@media print {
    #invoice-template-no[contenteditable="true"],
    #invoice-template-date[contenteditable="true"],
    #invoice-template-to[contenteditable="true"] {
        border: none !important;
        background: transparent !important;
        outline: none !important;
    }
}

/* === INVOICE DESCRIPTION TEXTAREA STYLES === */
.invoice-item-desc {
    line-height: 1.4 !important;
    font-family: inherit !important;
    resize: none !important;
    overflow: hidden !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 2px 0 !important;
    margin: 0 !important;
    vertical-align: top !important;
}

.invoice-item-desc:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Ensure table cells accommodate multi-line content */
#invoice-template-items-body td {
    vertical-align: top !important;
}

/* === INVOICE PRICE FIELD WITH CURRENCY STYLES === */
.invoice-item-price {
    border-right: none !important;
}

.invoice-item-price:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Ensure price and currency are aligned properly */
#invoice-template-items-body td .flex {
    white-space: nowrap;
}

/* === HIDE DELETE BUTTONS WHEN PRINTING === */
@media print {
    .remove-invoice-row {
        display: none !important;
    }
    
    /* Hide number input spinner buttons (up/down arrows) when printing */
    input[type="number"]::-webkit-outer-spin-button,
    input[type="number"]::-webkit-inner-spin-button {
        -webkit-appearance: none !important;
        margin: 0 !important;
    }
    
    input[type="number"] {
        -moz-appearance: textfield !important;
        appearance: textfield !important;
    }
}

/* Hide delete buttons and spinners when printing invoice specifically */
body.printing-invoice .remove-invoice-row {
    display: none !important;
}

body.printing-invoice input[type="number"]::-webkit-outer-spin-button,
body.printing-invoice input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

body.printing-invoice input[type="number"] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

/* Customer Autocomplete Styles */
#customer-suggestions {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-height: 15rem;
    overflow-y: auto;
    z-index: 50;
}

.customer-suggestion {
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.customer-suggestion:last-child {
    border-bottom: none;
}

.customer-suggestion:hover,
.customer-suggestion.selected {
    background-color: #f3f4f6;
}

.customer-suggestion .customer-name {
    font-weight: 600;
    color: #374151;
    display: block;
    margin-bottom: 0.25rem;
}

.customer-suggestion .customer-phone {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Customer Edit Modal Styles */
#customer-edit-phones-container .flex {
    margin-bottom: 0.5rem;
}

#customer-edit-phones-container .flex:last-child {
    margin-bottom: 0;
}

.customer-phone-input {
    transition: border-color 0.15s ease-in-out;
}

.customer-phone-input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
