html, body {
    margin: 0;
    padding: 0;
    overflow: auto;
    height: auto;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px;
    background-color: #f5f5f5;
    color: #333;
    box-sizing: border-box;
}

.container {
    max-width: 765px;
    margin: 0;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: auto;
    box-sizing: border-box;
}

/* Iframe optimization for main pages */
.iframe-optimized {
    overflow-y: auto !important;
    max-height: calc(100vh - 40px);
}

.iframe-optimized .container {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 15px;
}

.iframe-optimized .invoice-textarea {
    max-height: 200px !important;
    height: 200px !important;
}



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

.header {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.header h1 {
    color: #2c5aa0;
    margin: 0;
    font-size: 24px;
}

.header p {
    color: #666;
    margin: 5px 0 0 0;
}

.section {
    padding: 20px;
    padding-top: 10px;
    padding-bottom: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

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

.btn {
    background-color: #2c5aa0;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin: 5px;
    transition: background-color 0.3s;
}

.btn i {
    margin-right: 6px;
}

.btn-secondary i,
.btn-primary i {
    margin-right: 6px;
    display: inline-block;
}

.btn:hover {
    background-color: #1e3d6f;
}

.btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn-success {
    background-color: #28a745;
}

.btn-success:hover {
    background-color: #1e7e34;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}


.tab-btn {
    background: none;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

.tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: #fff;
}

/* Tab Content Styles */
.tab-content {
    display: block;
}

.tab-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 18px;
}

.tab-content > p {
    margin-bottom: 20px;
    color: #6c757d;
    font-size: 14px;
}

.help-text {
    margin-top: 10px;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
}

small.help-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
}


.invoice-textarea {
    width: 100%;
    height: 250px;
    max-height: 250px;
    background-color: #eaf0f1;
    border: 1px solid #eaf0f1;
    border-radius: 6px;
    padding: 16px;
    margin: 8px 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.4;
    color: #495057;
    resize: none;
    box-sizing: border-box;
    display: block;
    overflow-y: auto;
}

#server-response-data {
    white-space: pre;
    overflow-x: auto;
    overflow-y: auto;
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    line-height: 1.4;
    tab-size: 2;
}

.invoice-textarea:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.2);
}

/* Button container */
.button-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Footer styling */
.app-footer {
    text-align: center;
    margin-top: 20px;
    padding: 20px 0 0 0;
    border-top: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 12px;
}

.app-footer #app-version {
    font-weight: 600;
    color: #2c5aa0;
    background-color: #f8f9fa;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

/* Form Layout Styles */
.form-group {
    margin-bottom: 20px;
}

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

.form-col {
    flex: 1;
    margin-bottom: 0;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.2);
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-col {
        margin-bottom: 20px;
    }
}

.button-container .btn-left {
    flex: 0 0 auto;
}

.button-container .btn-right {
    flex: 0 0 auto;
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Responsive button layout */
@media (max-width: 768px) {
    .button-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .button-container .btn {
        width: 100%;
    }
}

.form-group {
    margin-bottom: 15px;
}

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

.form-group input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 12px;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-primary {
    background-color: #2c5aa0;
    color: white;
}

.btn-primary:hover {
    background-color: #1e3d6f;
}


/* Responsive form layout */
@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        margin: 5px 0;
    }
}

/* Business Setup Form Styles */
.form-control {
    width: 100%;
    height: 32px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.1);
}

.form-control:required {
    border-left: 3px solid #2c5aa0;
}

.form-control[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 13px;
}

label::after {
    content: '';
}

label[for$="*"]::after,
label:has(+ .form-control[required])::after,
label:has(+ select[required])::after {
    content: ' *';
    color: #dc3545;
}

select.form-control {
    cursor: pointer;
    height: 32px;
}

textarea.form-control {
    resize: vertical;
    min-height: 64px;
    height: auto;
}

input.form-control {
    height: 32px;
}

/* Form Sections */
.form-section {
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background-color: #f8f9fa;
}
.form-section h1 {
    color: #2c5aa0;
    margin: 0;
    font-size: 24px;
}

.form-section p {
    color: #666;
    margin: 5px 0 0 0;
}

/* Custom SweetAlert2 Styling */
.swal2-popup {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12) !important;
    width: 480px !important;
    padding: 25px !important;
    border: 1px solid #e9ecef !important;
}

.swal2-icon {
    display: none !important;
}

.swal2-header {
    padding-bottom: 15px !important;
    border-bottom: 2px solid #f8f9fa !important;
    margin-bottom: 15px !important;
}

.swal2-title {
    color: #2c3e50 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    margin-bottom: 20px !important;
    line-height: 1.3 !important;
    text-align: center !important;
}

/* Title colors based on alert type */
.swal2-popup.swal2-modal.swal2-icon-warning .swal2-title,
.swal2-popup[class*="swal2-icon-warning"] .swal2-title {
    color: #f39c12 !important;
}

.swal2-popup.swal2-modal.swal2-icon-error .swal2-title,
.swal2-popup[class*="swal2-icon-error"] .swal2-title {
    color: #e74c3c !important;
}

.swal2-popup.swal2-modal.swal2-icon-success .swal2-title,
.swal2-popup[class*="swal2-icon-success"] .swal2-title {
    color: #27ae60 !important;
}

.swal2-popup.swal2-modal.swal2-icon-info .swal2-title,
.swal2-popup[class*="swal2-icon-info"] .swal2-title {
    color: #3498db !important;
}

.swal2-content {
    color: #495057 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
}

.swal2-html-container {
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.swal2-confirm {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3d6f 100%) !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 3px 8px rgba(44, 90, 160, 0.3) !important;
}

.swal2-confirm:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.4) !important;
}

.swal2-cancel {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 3px 8px rgba(108, 117, 125, 0.3) !important;
}

.swal2-cancel:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4) !important;
}

.swal2-actions {
    margin-top: 20px !important;
    gap: 12px !important;
    justify-content: center !important;
}

.swal2-footer {
    font-size: 12px !important;
    color: #6c757d !important;
    margin-top: 12px !important;
    text-align: center !important;
}

.form-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #495057;
    font-size: 18px;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
}

/* Manager Integration Setup - Center only this specific section */
#manager-integration-setup {
    text-align: center;
}

#manager-integration-setup h2 {
    text-align: center;
    border-bottom: 2px solid #dee2e6;
    display: inline-block;
    padding-bottom: 10px;
    margin: 0 auto 20px auto;
}

#manager-integration-setup p {
    text-align: center;
    margin: 0 auto 20px auto;
}

#manager-integration-setup .form-actions {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

#manager-integration-setup .form-actions button {
    margin: 0 auto;
}

/* Override text-align for button-container to maintain left-right layout */
#manager-integration-setup .button-container {
    text-align: left !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 20px;
    flex-wrap: wrap;
}

#manager-integration-setup .button-container .btn-left {
    flex: 0 0 auto;
}

#manager-integration-setup .button-container .btn-right {
    flex: 0 0 auto;
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Center status indicator in Manager Integration Setup */
#manager-integration-setup .status-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: 15px auto 0 auto;
}

/* Ensure Business Setup Configuration is left-aligned */
form .form-section {
    text-align: left;
}

form .form-section h2,
form .form-section .form-group {
    text-align: left;
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 4px;
    background-color: #fff;
    border: 1px solid #dee2e6;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    display: inline-block;
}

.status-unknown {
    background-color: #6c757d;
}

.status-success {
    background-color: #28a745;
}

.status-error {
    background-color: #dc3545;
}

.status-testing {
    background-color: #ffc107;
    animation: pulse 1.5s infinite;
}

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

.status-text {
    font-weight: 500;
    color: #495057;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.form-actions .btn {
    min-width: 150px;
}


/* Tab System Styles */

.tab-nav {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 0;
}

.tab-btn {
    background-color: transparent;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    margin: 0;
    border-radius: 0;
}

.tab-btn:hover {
    background-color: #f8f9fa;
    color: #2c5aa0;
}

.tab-btn.active {
    color: #2c5aa0;
    border-bottom-color: #2c5aa0;
    background-color: #f8f9fa;
}

.tab-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
    background-color: transparent;
}

.tab-btn:disabled:hover {
    background-color: transparent;
    color: #ccc;
}

.tab-content {
    position: relative;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-pane.active {
    display: block;
}

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

