/**************************************************
 * MODERN INVOICE MODULE - MINIMALIST STYLES
 **************************************************/

/* Base Invoice Container */
#invoice {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #2c3e50;
    line-height: 1.6;
}

#invoice .invoice-container {
    /* width: 1000px; */
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f7fa;
}

#invoice .invoice-content {
    width: 100%;
}

/* Module Controls */
#invoice .module-controls {
        flex: 1;
    /* padding: 8px 12px; */
    /* border: 1px solid #e1e8ed; */
    /* border-radius: 6px; */
    background-color: #f8f9fa;
    font-size: 14px;
    color: #2c3e50;
}

#invoice .module-controls select {
   flex: 1;
   padding: 7px;
   border: 1px solid #e1e8ed;
   border-radius: 6px;
   background-color: white;
   font-size: 12px;
   color: #34495e;
}

#invoice .module-controls button {
    padding: 8px 16px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#invoice .module-controls button:hover {
    background-color: #34495e;
}

/* Header Section */
#invoice .header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* margin-bottom: 3px; */
    /* padding-bottom: 5px; */
    border-bottom: 1px solid #e1e8ed;
}

#invoice .header-left {
    flex: 0 0 40%;
    max-width: 40%;
}

#invoice .title {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 20px 0;
    letter-spacing: -0.02em;
}

#invoice .invoice-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 300px;
}

input#invoiceNumber {
    width: 75% !important;
}
#invoice .header-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    /* align-items: flex-end; */
    /* flex: 1; */
    width: 250px;
    padding-left: 65px;
}

/* Logo Container */
#invoice .logo-container,
#invoice #logoUploadArea {
    /* width: 200px; */
    height: 62px;
    border: 2px dashed #e1e8ed;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: white;
    margin-bottom: 15px;
    transition: border-color 0.2s ease;
}

#invoice .logo-container:hover,
#invoice #logoUploadArea:hover {
    border-color: #2c3e50;
}

#invoice .logo-container span,
#invoice #noLogoText {
    color: #7f8c8d;
    font-size: 12px;
    text-align: center;
}

#invoice .logo-container img,
#invoice #companyLogoDisplay {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Company Information */
#invoice .company-name,
#invoice #invoice-company-name {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    /* margin: 10px 0; */
    /* min-height: 24px; */
    outline: none;
    /* padding: 8px; */
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    /* width: 250px; */
    text-transform: uppercase;
    text-align: left;
    background: white;
}

#invoice .company-name:focus,
#invoice #invoice-company-name:focus {
    background-color: white;
    border-color: #2c3e50;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

#invoice .address-textarea,
#invoice #invoice-company-address {
    /* width: 250px; */
    min-height: 60px;
    padding: 8px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 11px !important;
    color: #2c3e50;
    background-color: white;
    resize: vertical;
    font-family: inherit;
}

#invoice .address-textarea:focus,
#invoice #invoice-company-address:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

/* Section Titles */
#invoice .section-title {
    color: #2c3e50;
    font-size: 16px !important;
    font-weight: 600;
    /* margin: 30px 6px 15px 0; */
    padding: 0px 3px;
    background-color: #f8f9fa;
    border-left: 4px solid #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 14px;
}

/* Company Box */
#invoice .company-box {
    padding: 6px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
    margin-bottom: -23px !important;
    width: 100%;
}

/* Form Elements */
#invoice input[type="text"],
#invoice input[type="date"],
#invoice input[type="number"],
#invoice #customerName,
#invoice #invoiceNumber,
#invoice #invoiceDate {
  width: 100%;
  padding: 5px;
  border: 1px solid #e1e8ed;
  border-radius: 4px;
  font-size: 12px !important;
  color: #2c3e50;
  box-sizing: border-box;
  align-text: top;
  background: white;
  font-family: inherit;
  min-height: 25px;
}

#invoice input:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

#invoice #customerName {
    font-weight: 600;
    width: 50%;
    text-transform: capitalize;
    font-size: 16px !important;
}

#invoice #customerAddress {
    width: 50%;
    /* min-height: 80px; */
    /* padding: 10px 12px; */
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 12px;
    color: #2c3e50;
    background-color: white;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 25px;
}

#invoice label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

/* Remove number input spinners */
#invoice input[type="number"]::-webkit-inner-spin-button,
#invoice input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#invoice input[type="number"] {
    -moz-appearance: textfield;
}

/* Tables */
#invoice table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    background-color: #f5f7fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#invoice th {
    background-color: var(--primary);
    color: white;
    padding: 9px 8px;
    text-align: center;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

#invoice td {
    /* padding: 5px 5px; */
    border-bottom: 1px solid #e1e8ed;
    vertical-align: top;
    font-size: 12px;
    background: white;
    min-height: ;
}

#invoice tbody tr:last-child td {
    border-bottom: none;
}

#invoice tbody tr:hover {
    background-color: #f8f9fa;
}

#invoice tfoot tr {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

#invoice tfoot td {
    border-bottom: none;
    padding: 5px 10px;
    background: #34495e;
    font-size: 14px;
    color: white;

}

#invoice .text-right,
#invoice #invoiceTotal,
#invoice .item-total,
#invoice .term-amount,
#invoice #paymentTermsAmountTotal {
    text-align: right;
}

#invoice .text-center {
    text-align: center;
}

/* Table Inputs */
#invoice table input,
#invoice table textarea {
    width: 100%;
    /* padding: 6px 8px; */
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    font-size: 11px !important;
    color: #2c3e50;
    /* box-sizing: border-box; */
    font-family: inherit;
}

#invoice table input:focus,
#invoice table textarea:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.1);
}

#invoice table textarea {
    min-height: 21px !important;
    resize: vertical;
    background: white;
}

/* Buttons */
#invoice .control-btn,
#invoice #addItem,
#invoice #addPaymentTerm{
    display: inline-block;
    padding: 4px 8px;
    background-color: #34495e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    margin: 10px 0;
    transition: all 0.2s ease;
    
}

#invoice #saveInvoice,
#invoice #printInvoice,
#invoice #emailInvoice,
#invoice #resetInvoice {
    padding: 10px 8px;
    background-color: #34495e;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    margin: 5px;
    width: 100px;
    transition: all 0.2s ease;
}

#invoice .control-btn:hover,
#invoice #addItem:hover,
#invoice #addPaymentTerm:hover,
#invoice #saveInvoice:hover,
#invoice #printInvoice:hover {
    background-color: #34495e;
    transform: translateY(-1px);
}

 
#invoice .control-buttons {
    margin-top: 30px;
    text-align: center;
}
td.border.p-2.no-print.text-center {
    text-align: left;
    align-items: flex-end;
    display: flex;
    justify-content: flex-end;
}
/* Remove Item Buttons */
#invoice .remove-item,
#invoice .remove-term {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

#invoice .remove-item:hover,
#invoice .remove-term:hover {
    background-color: #c0392b;
}

/* Signature Section */
#invoice .signature {
    /* margin: 30px 0; */
    /* padding: 20px; */
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

#invoice .signature-location,
#invoice .invoice-signature-city {
    display: flex;
    /* gap: 15px; */
    /* margin-bottom: 20px; */
    align-items: flex-end;
    /* max-width: 14px; */
}

input#signatureCity_duplicate_1 {
    width: 80px;
    font-size: 11px !important;
}

input#signatureDate_duplicate_1 {
    font-size: 11px !important;
}   
#invoice .signature-location > div,
#invoice .invoice-signature-city > div {
    /* flex: 1; */
}

#invoice .signature-container,
#invoice #signatureUploadArea {
    width: 202px;
    height: 50px;
    border: 2px dashed #e1e8ed;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    background-color: #f8f9fa;
    transition: border-color 0.2s ease;
    /* margin: 10px 0; */
}

#invoice .signature-container:hover,
#invoice #signatureUploadArea:hover {
    border-color: #2c3e50;
}

#invoice .signature-container img,
#invoice #signatureDisplay {
    max-width: 150px;
    max-height: 60px;
    object-fit: contain;
}

#invoice #signaturePlaceholder {
    color: #7f8c8d;
    font-size: 12px;
    text-align: center;
    border-bottom: 1px solid #2c3e50;
    width: 150px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

#invoice .invoice-signName {
    width: 200px;
}

#invoice .signature-line {
    width: 200px;
    height: 1px;
    background-color: #2c3e50;
    margin-top: 10px;
}

#invoice #signName,
#invoice #signatureCity,
#invoice #signatureDate {
    width: 100%;
    max-width: 200px;
}

/* File Upload Inputs */
#invoice #logo-upload,
#invoice #signature-upload {
    display: none;
}

/* Notes Section */
#invoice #notes {
    width: 100%;
    min-height: 50px;
    padding: 10px 12px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 12px;
    color: #2c3e50;
    background-color: white;
    resize: vertical;
    font-family: inherit;
}

/* Payment Terms Section */
#invoice .term-name,
#invoice .term-percentage,
#invoice .term-description {
    padding: 8px;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    font-size: 13px;
    color: #2c3e50;
    width: 100%;
    box-sizing: border-box;
}

#invoice .term-percentage {
    width: 60px;
    text-align: center;
}

#invoice #paymentTermsPercentTotal {
    font-weight: 600;
}

#invoice #paymentTermsPercentTotal.text-green-500 {
    color: #27ae60;
}

#invoice #paymentTermsPercentTotal.text-gray-300 {
    color: #95a5a6;
}

/* Print Styles */
/*@media print {
    #invoice .no-print {
        display: none !important;
    }
    
    #invoice .invoice-content {
        width: 100% !important;
    }
    
    #invoice input,
    #invoice textarea,
    #invoice select {
        border: none !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
        background: transparent !important;
        padding: 0 !important;
    }
    
    #invoice table {
        table-layout: fixed !important;
        width: 100% !important;
    }
    
    #invoice .text-right,
    #invoice .item-total,
    #invoice #invoiceTotal,
    #invoice .term-amount,
    #invoice #paymentTermsAmountTotal {
        text-align: right !important;
    }
    
    #invoice #signaturePlaceholder {
        border-bottom: 1px solid black !important;
    }
}*/

/* Responsive Design */
@media (max-width: 768px) {
    #invoice .invoice-container {
        width: 100%;
        padding: 15px;
    }
    
    #invoice .header {
        flex-direction: column;
        gap: 20px;
    }
    
    #invoice .header-left,
    #invoice .header-right {
        max-width: 100%;
        width: 100%;
    }
    
    #invoice .address-textarea,
    #invoice #invoice-company-address,
    #invoice .company-name,
    #invoice #invoice-company-name {
        width: 100%;
    }
    
    #invoice .signature-location,
    #invoice .invoice-signature-city {
        flex-direction: column;
        gap: 10px;
    }
    
    #invoice .control-buttons {
        flex-direction: column;
    }
    
    #invoice .control-btn {
        width: 100%;
        margin: 5px 0;
    }
    
    #invoice table {
        font-size: 12px;
    }
    
    #invoice th,
    #invoice td {
        padding: 6px 4px;
    }
}

/* Focus States */
#invoice *:focus {
    outline: none;
}

#invoice input:focus,
#invoice textarea:focus,
#invoice select:focus,
#invoice button:focus {
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.2);
}