:root {
    --primary-color: #2563eb;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body {
    font-family: 'Sarabun', Arial, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
}

.main-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    padding: 2rem;
    max-width: 900px;
}

.page-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-type-btn {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 15px;
    padding: 2rem;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #374151;
    display: block;
}

.form-type-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.form-type-btn.quote {
    border-color: var(--primary-color);
}

.form-type-btn.delivery {
    border-color: var(--success-color);
}

.form-type-btn.receipt {
    border-color: var(--warning-color);
}

.form-type-btn:hover.quote {
    background: var(--primary-color);
    color: white;
}

.form-type-btn:hover.delivery {
    background: var(--success-color);
    color: white;
}

.form-type-btn:hover.receipt {
    background: var(--warning-color);
    color: white;
}

.btn-modern {
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-control,
.form-select {
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    padding: 12px 16px;
    transition: border-color 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.table-modern {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.table-modern th {
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
}

.preview-document {
    background: white;
    border-radius: 15px;
    padding: 0rem 1rem 1rem 1rem;
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); */
    margin: 0;
}

.preview-document td {
    height: 20px;
}

.company-header {
    text-align: center;
    border-bottom: 3px solid;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.company-name {
    font-size: 1.8rem;
    font-weight: bold;
    color: black;
}

.customer-name-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: #374151;
}

.doc-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: black;
}

.summary-row td {
    background: #f8fafc;
    font-weight: 600;
}

@media print {
    body {
        background: white;
    }

    .main-container {
        background: white;
        box-shadow: none;
        margin: 0;
        border-radius: 0;
    }

    .no-print {
        display: none !important;
    }

    .page-break {
        page-break-before: always;
    }

    #document-preview {
        page-break-inside: avoid;
    }
}

@media (max-width: 768px) {
    .main-container {
        margin: 10px;
        padding: 1rem;
    }

    .form-type-btn {
        padding: 1.5rem;
    }
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 2rem;
}

.signature-block {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    font-size: 0.95rem;
}

.signature-item {
    width: 45%;
    text-align: center;
}

.signature-item .label {
    margin-bottom: 0.5rem;
}

.signature-item .line {
    display: inline-block;
    width: 100%;
    border-bottom: 1px solid #000;
    margin-top: 0.25rem;
    padding-bottom: 0.25rem; 
}

.ts-control {
  height: calc(1.5em + .75rem + 2px) !important;
  line-height: 1.5 !important;
  white-space: nowrap !important;
}