/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding-left: 280px; /* Make space for the fixed sidebar */
}

#submissions-panel {
    width: 280px;
    min-width: 280px;
    height: 100vh;
    background-color: #2c3e50;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex; /* Show by default on desktop */
    flex-direction: column;
}

#submissions-panel h2 {
    margin: 20px 20px 0;
    padding-bottom: 10px;
    font-size: 20px;
    border-bottom: 1px solid #46627f;
}

#submissions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1; /* Allows the list to take up available space */
}

#submissions-list li {
    padding: 15px 20px;
    border-bottom: 1px solid #46627f;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.panel-footer {
    padding: 20px;
    border-top: 1px solid #46627f;
}

.panel-action-btn {
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: center;
}

.panel-action-btn:hover {
    background-color: #2980b9;
}

#submissions-list li:hover {
    background-color: #34495e;
}

/* Selected invoice styling */
#submissions-list li.selected {
    background-color: #0c5281;
    border-left: 4px solid #2980b9;
    position: relative;
}

#submissions-list li.selected:hover {
    background-color: #0c5281;
}

#submissions-list li.selected::before {
    content: "✓";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    font-weight: bold;
    color: #ecf0f1;
}

/* Search container styling */
.search-container {
    position: relative;
    margin-bottom: 15px;
    width: 100%;
}

#customer-search {
    width: 100%;
    padding: 10px 35px 10px 12px;
    border: 1px solid #34495e;
    border-radius: 6px;
    background-color: #d9e6f2;
    color: #002731;
    font-size: 16px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.3s ease;
}

#customer-search::placeholder {
    color: #7f8c8d;
}

#customer-search:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    pointer-events: none;
    font-size: 14px;
}

/* #submissions-list li .invoice-id {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
} */

#submissions-list li .customer-name {
    font-weight: bold;
    font-size: 16px;
    /* color: #bdc3c7; */
    margin-bottom: 2px;
}

#submissions-list li .invoice-date {
    font-size: 14px;
    color: #95a5a6;
}

#submissions-list li .customer-address {
    font-size: 14px;
    color: #95a5a6;
    margin-top: 3px;
    /* font-style: italic; */
    line-height: 1.2;
}

/* Container and general styling */
.container {
    max-width: 1000px;
    margin: 20px auto; /* This will now center the container in the padded body */
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Wrapper for Google Place Picker to enforce styling */
.place-picker-wrapper {
    position: relative;
    width: 100%;
}

/* Google Place Picker Styling - Match other form inputs */
.place-picker-wrapper gmpx-place-picker {
    width: 100% !important;
    height: 42px !important; /* Match other inputs */
    box-sizing: border-box !important;
}

/* Target the internal input of the component */
.place-picker-wrapper gmpx-place-picker::part(input) {
    width: 100% !important;
    height: 42px !important;
    padding: 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-family: 'Arial', sans-serif !important;
    transition: border-color 0.3s ease !important;
    box-sizing: border-box !important;
}

/* Focus state for the internal input */
.place-picker-wrapper gmpx-place-picker::part(input):focus {
    outline: none !important;
    border-color: #3498db !important;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3) !important;
}

/* Company Header */
.company-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #2c3e50;
}

.logo-section {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.company-logo {
    width: 140px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.company-info {
    flex: 1;
}

.company-name {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
    outline: none;
    border: 1px solid transparent;
    padding: 5px;
    border-radius: 4px;
}

.company-name:focus {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.company-details {
    color: #666;
    font-size: 14px;
    outline: none;
    border: 1px solid transparent;
    padding: 5px;
    border-radius: 4px;
    min-height: 60px;
}

.company-details:focus {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.invoice-info {
    text-align: right;
}

.invoice-info h2 {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.invoice-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.invoice-meta > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.invoice-meta label {
    font-weight: bold;
    min-width: 80px;
    text-align: left;
}

.invoice-meta input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 150px;
}

/* Customer Section */
.customer-section {
    margin-bottom: 30px;
}

.customer-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

.customer-form {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* Phone input specific styling */
#customerPhone {
    letter-spacing: 0.3px;
}

/* Address input container styling */
.address-input-container {
    position: relative;
}

.place-picker-wrapper,
.manual-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.manual-input-toggle,
.google-input-toggle {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 16px;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
}

.manual-input-toggle:hover,
.google-input-toggle:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.manual-input-toggle:active,
.google-input-toggle:active {
    background-color: #dee2e6;
    transform: scale(0.98);
}

#customerPhone::placeholder {
    /* font-family: Arial, sans-serif; */
    letter-spacing: normal;
    font-weight: normal;
    color: #999;
}

/* Items Section */
.items-section {
    margin-bottom: 30px;
}

.items-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

.items-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.items-header {
    display: grid;
    grid-template-columns: 30px 60px 2fr 80px 80px;
    gap: 10px;
    padding: 15px;
    background-color: white;
    color: #2c3e50;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
}

.items-header > div {
    text-align: center;
}

.item-description {
    text-align: left !important;
}

.item-number {
    text-align: center !important;
    font-weight: bold;
}

.invoice-item-number {
    text-align: center;
    font-weight: bold;
    color: #2c3e50;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.invoice-item {
    display: grid;
    grid-template-columns: 30px 60px 2fr 80px 80px;
    gap: 10px;
    padding: 15px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.invoice-item:last-child {
    border-bottom: none;
}

.invoice-item input,
.invoice-item textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.invoice-item textarea {
    resize: none;
    min-height: 40px;
    overflow: hidden;
    line-height: 1.4;
    font-family: inherit;
}

/* Description container with microphone button */
.description-container {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.description-container textarea {
    flex: 1;
}

/* New button column layout */
.button-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
    min-width: 60px;
    max-width: 60px;
}

/* Improve button styling - Simple Design */
.improve-btn {
    background: #27ae60 !important;
    color: white !important;
    border: none !important;
    padding: 4px 6px !important;
    border-radius: 4px !important;
    cursor: pointer;
    font-size: 10px !important;
    font-weight: 500 !important;
    font-family: 'Arial', sans-serif !important;
    width: 100%;
    height: 22px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease !important;
    user-select: none;
    white-space: nowrap;
    box-shadow: none !important;
    text-shadow: none !important;
    gap: 3px !important; /* Add gap between icon and text */
}

.improve-btn .btn-icon {
    width: 12px !important;
    height: 12px !important;
    margin-right: 0 !important; /* Remove default margin since we're using gap */
    flex-shrink: 0;
}

.improve-btn:hover:not(:disabled) {
    background: #16a34a !important;
}

.improve-btn:active {
    background: #15803d !important;
}

.improve-btn:disabled {
    background: #d1d5db !important;
    color: #9ca3af !important;
    cursor: not-allowed;
}

.improve-btn:disabled:hover {
    background: #d1d5db !important;
}

.mic-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    user-select: none;
}

.mic-button:hover {
    background-color: #2980b9;
    transform: scale(1.05);
}

.mic-button:active {
    transform: scale(0.95);
}

.mic-button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.mic-button.disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.mic-button.disabled:hover {
    background-color: #bdc3c7;
    transform: none;
}

/* Voice buttons container for dual language buttons */
.voice-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}

/* Language-specific mic buttons - Simple Design */
.mic-button-lang {
    background: #667eea !important;
    color: white !important;
    border: none !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    cursor: pointer;
    font-size: 10px !important;
    font-family: 'Arial', sans-serif !important;
    width: 100%;
    height: 22px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease !important;
    user-select: none;
    white-space: nowrap;
    box-shadow: none !important;
    text-shadow: none !important;
}

.mic-button-lang:hover {
    background: #5a67d8 !important;
}

.mic-button-lang:active {
    background: #553c9a !important;
}

.mic-button-lang:disabled {
    background: #cbd5e0 !important;
    color: #a0aec0 !important;
    cursor: not-allowed;
}

.mic-button-lang.disabled {
    background: #cbd5e0 !important;
    color: #a0aec0 !important;
    cursor: not-allowed;
}

.mic-button-lang.disabled:hover,
.mic-button-lang:disabled:hover {
    background: #cbd5e0 !important;
}

.remove-item {
    background: #ef4444 !important;
    color: white !important;
    border: none !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    cursor: pointer;
    font-size: 10px !important;
    font-weight: 500 !important;
    font-family: 'Arial', sans-serif !important;
    width: 100%;
    height: 22px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease !important;
    user-select: none;
    white-space: nowrap;
    box-shadow: none !important;
    text-shadow: none !important;
    position: static !important;
    overflow: visible !important;
    opacity: 1 !important;
    letter-spacing: normal !important;
}

.remove-item:hover {
    background: #dc2626 !important;
}

.remove-item:active {
    background: #b91c1c !important;
}

.add-item-btn {
    width: 100%;
    padding: 15px;
    background-color: #27ae60;
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.add-item-btn:hover {
    background-color: #219a52;
}

/* Summary Section */
.summary-section {
    margin-bottom: 30px;
}

.summary-content {
    display: flex;
    gap: 30px;
}

.notes-section {
    flex: 1;
}

.notes-section h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.notes-section textarea {
    width: 100%;
    height: 120px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

.totals-section {
    min-width: 250px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 5px 0;
}

.total-row span:first-child {
    font-weight: bold;
    color: #555;
}

.total-row span:last-child {
    color: #2c3e50;
}

.tax-input {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tax-input input {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-family: 'Arial', sans-serif !important;
    font-size: 16px;
}

.total-final {
    border-top: 2px solid #2c3e50;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 18px;
}

.total-final span {
    font-weight: bold;
    color: #2c3e50;
}

/* Button icon styling */
.btn-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
    filter: brightness(0) saturate(100%); /* Makes SVG inherit the button text color */
}

/* White icons for buttons with dark backgrounds */
.save-download-btn .btn-icon,
.save-btn .btn-icon,
.panel-action-btn .btn-icon,
.add-item-btn .btn-icon,
.remove-item .btn-icon,
.mic-button-lang .btn-icon,
.improve-btn .btn-icon {
    filter: brightness(0) saturate(100%) invert(1); /* Makes icons white */
}

/* Dark icons for buttons with light backgrounds */
.email-btn .btn-icon {
    filter: brightness(0) saturate(100%); /* Makes icons dark */
}

/* Action Buttons */
.actions-section {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 20px;
}

.action-btn {
    padding: 12px 25px;
    border: 2px solid transparent;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    min-width: 160px;
}

.save-download-btn,
.save-btn {
    background-color: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.save-download-btn:hover:not(:disabled),
.save-btn:hover:not(:disabled) {
    background-color: #34495e;
}

.save-download-btn:disabled,
.save-btn:disabled {
    background-color: #95a5a6;
    border-color: #95a5a6;
    cursor: not-allowed;
}

/* .save-btn {
    background-color: transparent;
    color: #27ae60;
    border-color: #27ae60;
} */

/* .save-btn:hover:not(:disabled) {
    background-color: #f8f9fa;
} */

/* .save-btn:disabled {
    background-color: #95a5a6;
    border-color: #95a5a6;
    color: #666;
    cursor: not-allowed;
} */

.email-btn {
    background-color: transparent;
    color: #2c3e50;
    border-color: #2c3e50;
}

.email-btn:hover {
    background-color: #f8f9fa;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 10px;
    border-radius: 10px;
    width: 95%;
    max-width: 900px;
    height: 90%;
    max-height: 800px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 5px;
    flex-shrink: 0;
}

.email-config {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 0px;
}

.send-email-btn {
    flex-shrink: 0;
    margin-top: auto;
    align-self: flex-end;
    margin-left: auto;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 38px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    z-index: 1001;
    flex-shrink: 0;
}

.close:hover {
    color: #000;
}

.email-config {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 0 0px; /* Add side padding */
}

.email-config .form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center align form groups */
}

.email-config .form-group label {
    align-self: flex-start; /* Keep labels left-aligned */
    margin-left: 10%; /* Align with input fields */
}

.email-config .form-group input,
.email-config .form-group textarea {
    width: 90%; /* Make inputs smaller */
    max-width: 700px; /* Set maximum width */
}

.email-config textarea {
    height: 120px;
}

/* Center align the invoice preview */
#downloadLinkPreview {
    display: flex;
    justify-content: center;
    width: 100%;
}

#downloadLinkPreview .download-link-container {
    width: 90%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 4px;
    background-color: #f9f9f9;
}

#invoicePreviewContainer {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.preview-title {
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.preview-description {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    text-align: center;
}

#invoicePreviewFrame {
    width: 80%;
    max-width: 600px;
    height: 400px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 0 auto;
    display: block;
}

.email-success-message {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
}

.email-success-message h3 {
    color: #27ae60;
    margin-bottom: 10px;
    font-size: 18px;
}

.email-success-message p {
    color: #666;
    margin-bottom: 20px;
}

/* Email Modal Styles */
.email-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.email-modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.email-modal-header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.email-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.email-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.email-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.email-modal-content {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.email-modal-content .form-group {
    margin-bottom: 20px;
}

.email-modal-content .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
    font-size: 16px;
}

.email-modal-content .form-group input,
.email-modal-content .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-family: 'Arial', sans-serif;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.email-modal-content .form-group input:focus,
.email-modal-content .form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
}

.email-modal-content .form-group textarea {
    height: 120px;
    resize: vertical;
}

.email-modal-content .preview-section {
    margin: 30px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
    text-align: center;
}

.email-modal-content .preview-title {
    font-weight: bold;
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
}

.email-modal-content .preview-iframe {
    width: 100%;
    max-width: 600px;
    height: 400px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin: 0 auto 15px;
    display: block;
}

.email-modal-content .preview-description {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.email-modal-content .button-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.email-modal-content .btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-family: 'Arial', sans-serif;
}

.email-modal-content .btn-cancel {
    background-color: #95a5a6;
    color: white;
}

.email-modal-content .btn-cancel:hover {
    background-color: #7f8c8d;
}

.email-modal-content .btn-send {
    background-color: #27ae60;
    color: white;
    min-width: 150px;
}

.email-modal-content .btn-send:hover {
    background-color: #219a52;
}

.email-modal-content .btn-send:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.email-modal-content .success-message {
    text-align: center;
    padding: 40px 20px;
}

.email-modal-content .success-message h3 {
    color: #27ae60;
    margin-bottom: 15px;
    font-size: 24px;
}

.email-modal-content .success-message p {
    color: #666;
    margin-bottom: 25px;
    font-size: 16px;
}

.email-modal-content .error-message {
    background-color: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Responsive adjustments for email modal */
@media (max-width: 768px) {
    .email-modal-overlay {
        padding: 10px;
    }
    
    .email-modal-container {
        max-height: 95vh;
    }
    
    .email-modal-header {
        padding: 15px 20px;
    }
    
    .email-modal-header h2 {
        font-size: 20px;
    }
    
    .email-modal-content {
        padding: 20px;
    }
    
    .email-modal-content .preview-iframe {
        height: 300px;
    }
    
    .email-modal-content .button-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .email-modal-content .btn {
        width: 100%;
        max-width: 300px;
    }
}
@media (max-width: 700px) {
    body {
        padding-left: 0 !important;
    }
    .container {
        margin-left: 0 !important;
    }
    #submissions-panel {
        position: fixed;
        top: 0;
        left: 0;
        width: 90vw;
        max-width: 400px;
        height: 100vh;
        background: #2c3e50;
        color: white;
        box-shadow: 2px 0 12px rgba(0,0,0,0.15);
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        display: flex !important;
        flex-direction: column;
    }
    #submissions-panel.open {
        transform: translateX(0);
    }
    .mobile-only {
        display: block !important;
    }
    #open-panel-btn {
        display: block !important;
        background-color: #2c3e50;
        color: white;
        border: none;
        border-radius: 6px;
        font-size: 16px;
        font-weight: bold;
        cursor: pointer;
        transition: background-color 0.3s ease;
        text-align: center;
        padding: 7px 20px;
        box-shadow: 0 2px 8px rgba(44,62,80,0.08);
    }
    #close-panel-btn {
        display: block !important;
    }
}

@media (min-width: 701px) {
    .mobile-only {
        display: none !important;
    }
    #submissions-panel {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        min-width: 280px;
        height: 100vh;
        background-color: #2c3e50;
        color: white;
        z-index: 100;
        display: flex !important;
        flex-direction: column;
        transform: none;
        box-shadow: none;
    }
    body {
        padding-left: 280px;
    }
}

/* Responsive Design */
@media (max-width: 638px) {
    .container {
        margin: 10px;
        padding: 20px;
    }
    
    .company-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .logo-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .invoice-info {
        text-align: center;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .items-header,
    .invoice-item {
        grid-template-columns: 1fr;
        gap: 5px;
        text-align: left;
    }
    
    .description-container {
        flex-direction: row;
        gap: 8px;
        align-items: flex-start;
    }
    
    .button-column {
        flex-direction: column;
        gap: 4px;
        min-width: 90px;
    }

    .mic-button {
        align-self: flex-start;
        width: auto;
    }    .items-header > div {
        text-align: left !important;
    }
    
    .summary-content {
        flex-direction: column;
    }
    
    .actions-section {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .container {
        box-shadow: none;
        margin: 0;
        padding: 20px;
    }
    
    .actions-section {
        display: none;
    }
    
    .add-item-btn {
        display: none;
    }
    
    .remove-item {
        display: none;
    }
    
    .company-name,
    .company-details {
        border: none !important;
        background: transparent !important;
    }
}

/* Animation for adding items */
.invoice-item {
    animation: slideIn 0.3s ease-out;
}

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

/* Animation for voice language popup */
@keyframes popupSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Make all font styles uniform across the site, matching the Customer Name style (Arial, sans-serif). Applies to all major elements and controls. */
body, input, textarea, select, button, label, h1, h2, h3, h4, h5, h6, .company-name, .company-details, .panel-action-btn, .action-btn, .add-item-btn, .remove-item, .items-header, .invoice-item, .description-container, .customer-section, .customer-form, .form-row, .form-group, .totals-section, .notes-section, .summary-section, #submissions-panel, #submissions-list, #open-panel-btn, #close-panel-btn {
    font-family: 'Arial', sans-serif !important;
}
