@font-face {
    font-family: 'Cairo';
    src: url('../assets/fonts/Cairo-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'Cairo';
    src: url('../assets/fonts/Cairo-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

/* --- Custom CSS Properties (Variables) --- */
:root {
    /* Colors - Enterprise Theme */
    --primary-color: #0B1D33; /* Dark Navy */
    --secondary-color: #FF7A00; /* JAD Orange */
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --bg-color: #F8F9FB; /* Very Light Gray */
    --card-bg: #FFFFFF;
    --border-color: #E5E7EB;
    
    /* Table specific */
    --table-header-bg: #0B1D33;
    --table-header-text: #FFFFFF;
    --table-row-alt: #F9FAFB;
    --table-row-hover: #F3F4F6;
    
    /* Typography */
    --font-family-ltr: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-family-rtl: 'Cairo', sans-serif;
    
    /* Spacing & Radius */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --spacing-xs: 6px;
    --spacing-sm: 10px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Soft Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

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

body {
    font-family: var(--font-family-ltr);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* RTL Support */
[dir="rtl"] {
    font-family: var(--font-family-rtl);
    text-align: right;
    font-weight: 500;
}
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] th, [dir="rtl"] label, [dir="rtl"] .btn, [dir="rtl"] .subtitle {
    font-weight: 600;
}
[dir="rtl"] .header-left,
[dir="rtl"] .header-right {
    flex-direction: row-reverse;
}
[dir="rtl"] .machines-table {
    text-align: right;
}
[dir="rtl"] .input-wrapper .input-icon {
    left: auto;
    right: 12px;
}
[dir="rtl"] .input-wrapper input,
[dir="rtl"] .input-wrapper select {
    padding-left: 12px;
    padding-right: 36px;
}
[dir="rtl"] .btn i {
    margin-right: 0;
    margin-left: 8px;
}

/* --- Layout --- */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* --- Enterprise Header --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    border-bottom: 4px solid var(--primary-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.header-left .logo {
    max-height: 60px;
    object-fit: contain;
}

.header-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2px;
    letter-spacing: -0.5px;
}

.header-title .subtitle {
    font-size: 0.875rem;
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.order-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #F3F4F6;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.order-badge i {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.language-switcher {
    display: flex;
    gap: 4px;
    background: #F3F4F6;
    padding: 4px;
    border-radius: 20px;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn img {
    width: 20px;
    border-radius: 2px;
}

.lang-btn:hover {
    color: var(--primary-color);
}

.lang-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* --- Cards / Sections --- */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-xl);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.section-title .section-icon {
    color: var(--secondary-color);
    width: 22px;
    height: 22px;
}

/* --- Form Elements --- */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: #9CA3AF;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    padding-left: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text-primary);
    background-color: #fff;
    transition: all 0.2s ease;
    outline: none;
    font-weight: 500;
}

.input-wrapper input:focus,
.input-wrapper select:focus,
.machines-table input:focus,
.machines-table select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(11, 29, 51, 0.1);
}

/* --- Table --- */
.table-container {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
    max-height: 500px;
}

.machines-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.machines-table th {
    background-color: var(--table-header-bg);
    color: var(--table-header-text);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.machines-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.machines-table tbody tr {
    background-color: #fff;
    transition: background-color 0.2s ease;
}

.machines-table tbody tr:nth-child(even) {
    background-color: var(--table-row-alt);
}

.machines-table tbody tr:hover {
    background-color: var(--table-row-hover);
}

/* Form inputs inside table */
.machines-table td input[type="text"],
.machines-table td select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
}

.machines-table td input[readonly] {
    background-color: #F3F4F6;
    color: var(--text-secondary);
    border-color: transparent;
    cursor: not-allowed;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.625rem 1.25rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.btn i {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #172B4D;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #E66A00;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-text {
    background-color: transparent;
    color: var(--text-secondary);
}

.btn-text:hover {
    color: var(--primary-color);
    background-color: #F3F4F6;
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    color: #EF4444; 
    border: 1px solid transparent;
}

.btn-icon:hover {
    background-color: #FEF2F2;
    border-color: #FCA5A5;
    color: #DC2626;
    border-radius: var(--border-radius-sm);
}

/* --- Action Footer --- */
.action-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-xl);
}

.primary-actions {
    display: flex;
    gap: var(--spacing-md);
}

/* --- Management Toolbar --- */
.management-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    gap: var(--spacing-md);
    border-top: 3px solid var(--primary-color);
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.toolbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.unsaved-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FFFBEB;
    color: #B45309;
    border: 1px solid #FCD34D;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(0.98); }
}

/* --- Modals --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(11, 29, 51, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: var(--spacing-md);
    opacity: 1;
    transition: opacity 0.2s ease;
}

.modal-dialog {
    background: #FFFFFF;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog.modal-lg {
    max-width: 960px;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
    background-color: #F8FAFC;
}

.modal-title-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title-icon {
    width: 20px;
    height: 20px;
    color: var(--secondary-color);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.modal-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.modal-close-btn:hover {
    background-color: #E2E8F0;
    color: #0F172A;
}

.modal-body {
    padding: var(--spacing-lg) var(--spacing-xl);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

/* --- Search List Table --- */
.search-input-wrapper {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

.search-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

[dir="rtl"] .search-input-icon {
    left: auto;
    right: 12px;
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

[dir="rtl"] .search-input-wrapper input {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
}

.search-input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(11, 29, 51, 0.1);
}

.orders-list-table-container {
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

.orders-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.orders-list-table th {
    background-color: #F1F5F9;
    color: var(--primary-color);
    font-weight: 700;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 5;
}

[dir="rtl"] .orders-list-table th {
    text-align: right;
}

.orders-list-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
}

.orders-list-table tbody tr:hover {
    background-color: #F8FAFC;
}

.order-no-pill {
    font-family: 'Inter', monospace, sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    background: #E2E8F0;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.order-actions-cell {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.btn-sm {
    padding: 4px 8px !important;
    font-size: 0.78rem !important;
    border-radius: 4px !important;
}

/* --- Settings Form Grid --- */
.settings-form-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.settings-form-grid .form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.settings-form-grid input,
.settings-form-grid select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

[dir="rtl"] .toast-container {
    right: auto;
    left: 24px;
}

.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 400px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    border-left: 4px solid var(--primary-color);
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s ease;
}

[dir="rtl"] .toast {
    border-left: none;
    border-right: 4px solid var(--primary-color);
}

.toast-success {
    border-left-color: #10B981;
    color: #065F46;
    background: #ECFDF5;
}

[dir="rtl"] .toast-success {
    border-right-color: #10B981;
}

.toast-error {
    border-left-color: #EF4444;
    color: #991B1B;
    background: #FEF2F2;
}

[dir="rtl"] .toast-error {
    border-right-color: #EF4444;
}

.toast-warning {
    border-left-color: #F59E0B;
    color: #92400E;
    background: #FFFBEB;
}

[dir="rtl"] .toast-warning {
    border-right-color: #F59E0B;
}

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

/* --- Print Styles --- */
@media print {
    body {
        background-color: white;
    }
    
    .app-container {
        padding: 0;
        max-width: none;
    }
    
    .management-toolbar,
    .modal-backdrop,
    .toast-container,
    .action-footer,
    #add-machine-btn,
    .btn-icon,
    .language-switcher,
    .action-th {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: none;
        padding: 0;
        margin-bottom: var(--spacing-xl);
    }
    
    input, select, textarea {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        box-shadow: none !important;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    .machines-table td {
        border-bottom: 1px solid #000;
    }
    
    .machines-table th:last-child,
    .machines-table td:last-child {
        display: none;
    }
    
    @page {
        size: A4 landscape;
        margin: 1cm;
    }
}

/* --- PDF HTML Template Styling --- */
#pdf-template {
    width: 297mm;
    margin: 0 auto;
    padding: 0;
    background-color: #FFFFFF;
    color: #0F172A;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
    box-sizing: border-box;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

[dir="rtl"] #pdf-template {
    font-family: 'Cairo', 'Noto Sans Arabic', 'Inter', sans-serif;
}

.pdf-page {
    width: 297mm;
    height: 210mm;
    min-height: 210mm;
    max-height: 210mm;
    position: relative;
    padding: 8mm 12mm 10mm 12mm;
    box-sizing: border-box;
    page-break-after: always;
    break-after: page;
    page-break-inside: avoid;
    break-inside: avoid;
    overflow: hidden;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
}

/* Watermark */
.pdf-watermark {
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130mm;
    max-width: 50%;
    opacity: 0.035;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

/* Page 1 Header */
.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0B1D33;
    padding-bottom: 2.5mm;
    margin-bottom: 2.5mm;
    position: relative;
    z-index: 2;
}

.pdf-header::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: #FF7A00;
}

[dir="rtl"] .pdf-header::after {
    left: auto;
    right: 0;
}

.pdf-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pdf-logo {
    height: 15mm;
    width: auto;
    object-fit: contain;
}

.pdf-logo-sm {
    height: 9mm;
    width: auto;
    object-fit: contain;
}

.pdf-header-title-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pdf-main-title {
    font-size: 15pt;
    font-weight: 800;
    color: #0B1D33;
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.2px;
}

.pdf-sec-title {
    font-size: 10.5pt;
    color: #64748B;
    font-weight: 600;
    margin-left: 6px;
}

[dir="rtl"] .pdf-sec-title {
    margin-left: 0;
    margin-right: 6px;
}

.pdf-doc-type {
    font-size: 7.5pt;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 1mm;
}

.pdf-header-meta {
    display: flex;
    align-items: center;
}

.pdf-order-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

[dir="rtl"] .pdf-order-badge {
    align-items: flex-start;
}

.pdf-badge-label {
    font-size: 7pt;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1px;
}

.pdf-badge-value {
    font-size: 11pt;
    font-weight: 800;
    color: #0B1D33;
    font-family: 'Inter', monospace, sans-serif;
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    border-left: 3px solid #FF7A00;
    padding: 2px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

[dir="rtl"] .pdf-badge-value {
    border-left: 1px solid #CBD5E1;
    border-right: 3px solid #FF7A00;
}

/* Page 2+ Continuation Header */
.pdf-continuation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1.5px solid #CBD5E1;
    padding-bottom: 2mm;
    margin-bottom: 2.5mm;
    position: relative;
    z-index: 2;
}

.pdf-cont-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-cont-title {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.pdf-cont-name {
    font-size: 11pt;
    font-weight: 800;
    color: #0B1D33;
}

.pdf-cont-sub {
    font-size: 8pt;
    font-weight: 600;
    color: #64748B;
}

.pdf-cont-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pdf-cont-badge {
    font-size: 8.5pt;
    font-weight: 700;
    color: #0B1D33;
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    border-left: 3px solid #FF7A00;
    padding: 2px 8px;
    border-radius: 3px;
}

[dir="rtl"] .pdf-cont-badge {
    border-left: 1px solid #CBD5E1;
    border-right: 3px solid #FF7A00;
}

.pdf-cont-page {
    font-size: 8pt;
    font-weight: 600;
    color: #64748B;
}

/* Order Information Card (Page 1 Only) */
.pdf-info-card {
    display: grid;
    grid-template-columns: 1fr 1px 1.4fr;
    gap: 4mm;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 5px;
    padding: 2mm 4mm;
    margin-bottom: 2.5mm;
    position: relative;
    z-index: 2;
}

.pdf-info-divider {
    background-color: #CBD5E1;
    width: 1px;
    height: 100%;
}

.pdf-info-col {
    display: flex;
    flex-direction: column;
}

.pdf-info-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 1.5mm;
    border-bottom: 1px solid #E2E8F0;
    padding-bottom: 1mm;
}

.pdf-info-icon {
    color: #FF7A00;
    font-size: 6.5pt;
}

.pdf-info-header h4 {
    font-size: 7.5pt;
    font-weight: 700;
    color: #0B1D33;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.pdf-info-content {
    display: flex;
    flex-direction: column;
    gap: 1.5mm;
}

.pdf-info-row {
    display: flex;
    align-items: baseline;
    font-size: 8pt;
    line-height: 1.3;
}

.pdf-info-row .pdf-label {
    color: #64748B;
    font-weight: 500;
    width: 85px;
    flex-shrink: 0;
}

.pdf-info-row .pdf-val {
    color: #0F172A;
    font-weight: 700;
    word-break: break-word;
}

.pdf-info-row .order-code {
    color: #0B1D33;
    font-family: 'Inter', monospace, sans-serif;
    font-weight: 800;
}

.pdf-info-row-dates {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pdf-date-item {
    display: flex;
    align-items: baseline;
    font-size: 8pt;
}

.pdf-date-item .pdf-label {
    color: #64748B;
    font-weight: 500;
    margin-right: 6px;
}

[dir="rtl"] .pdf-date-item .pdf-label {
    margin-right: 0;
    margin-left: 6px;
}

.pdf-date-item .pdf-val {
    color: #0F172A;
    font-weight: 700;
    font-family: 'Inter', monospace, sans-serif;
}

/* Machine Table */
.pdf-table-wrapper {
    width: 100%;
    position: relative;
    z-index: 2;
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 7.8pt;
    line-height: 1.35;
    background: #FFFFFF;
}

.pdf-table th {
    background-color: #0B1D33;
    color: #FFFFFF;
    font-size: 7.2pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2.2mm 2mm;
    border: 1px solid #0B1D33;
    vertical-align: middle;
    text-align: left;
}

[dir="rtl"] .pdf-table th {
    text-align: right;
}

.pdf-table th.col-num,
.pdf-table td.col-num {
    text-align: center !important;
}

.pdf-table th.col-pkg,
.pdf-table td.col-pkg,
.pdf-table th.col-ship,
.pdf-table td.col-ship {
    text-align: center;
}

.pdf-table td {
    padding: 2mm 2mm;
    border: 1px solid #CBD5E1;
    vertical-align: middle;
    word-break: break-word;
    overflow-wrap: break-word;
    color: #1E293B;
}

[dir="rtl"] .pdf-table td {
    text-align: right;
}

.pdf-table tbody tr:nth-child(even) {
    background-color: #F8FAFC;
}

.pdf-table td.machine-name-cell {
    font-weight: 700;
    color: #0B1D33;
    line-height: 1.25;
}

.pdf-table .mono-code {
    font-family: 'Inter', monospace, sans-serif;
    font-weight: 700;
    color: #0B1D33;
    font-size: 7.5pt;
    letter-spacing: 0.2px;
}

.pdf-table .serial-badge {
    font-family: 'Inter', monospace, sans-serif;
    font-weight: 600;
    color: #334155;
    font-size: 7.5pt;
}

.empty-cell {
    color: #94A3B8;
    font-weight: normal;
}

.ltr-content {
    display: inline-block;
    direction: ltr;
    unicode-bidi: isolate;
}

/* Signatures (Last Page Only) */
.pdf-signatures {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: auto;
    padding-top: 2.5mm;
    margin-bottom: 2mm;
    position: relative;
    z-index: 2;
}

.pdf-sig-box {
    width: 65mm;
    border: 1px dashed #CBD5E1;
    background: #FAFAFA;
    border-radius: 4px;
    padding: 2mm 3mm;
    text-align: center;
}

.pdf-sig-role {
    font-size: 8pt;
    font-weight: 700;
    color: #0B1D33;
    line-height: 1.2;
}

.pdf-sig-sub {
    font-size: 6.5pt;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

.pdf-sig-space {
    height: 9mm;
}

.pdf-sig-line {
    border-top: 1px solid #0B1D33;
    padding-top: 1.5mm;
    font-size: 6.5pt;
    color: #64748B;
    font-weight: 600;
}

/* Fixed Footer */
.pdf-footer {
    position: absolute;
    bottom: 3mm;
    left: 12mm;
    right: 12mm;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #E2E8F0;
    padding-top: 1.5mm;
    font-size: 6.8pt;
    color: #64748B;
    font-weight: 600;
    z-index: 2;
}

.pdf-footer-left {
    color: #0B1D33;
    font-weight: 700;
}

.pdf-footer-center {
    color: #64748B;
}

.pdf-footer-right .pdf-page-num {
    font-family: 'Inter', monospace, sans-serif;
    font-weight: 700;
    color: #0B1D33;
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    padding: 1px 6px;
    border-radius: 3px;
}
/* --- Login Page Styles --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-color);
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.login-language-switcher {
    display: flex;
    gap: 8px;
    background: #FFFFFF;
    padding: 6px;
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-sm);
}

.login-card {
    width: 100%;
    border-top: 4px solid var(--primary-color);
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.login-header .logo {
    height: 50px;
    margin-bottom: var(--spacing-md);
    object-fit: contain;
}

.login-header h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.login-submit-btn {
    width: 100%;
    padding: 0.75rem;
    margin-top: var(--spacing-sm);
    font-size: 1rem;
}

.login-error-msg {
    background-color: #FEF2F2;
    color: #DC2626;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    border: 1px solid #FCA5A5;
}
