/**
 * AXION Automotive Operations Intelligence — Quotations Department Styles
 * Strict Constraint: All components rendered in 'Times New Roman'
 */

/* ==========================================================================
   STRICT TYPOGRAPHY ENFORCEMENT
   ========================================================================== */
*,
*::before,
*::after,
html,
body,
.app-layout,
.app-sidebar,
.app-sidebar *,
.app-topbar,
.app-topbar *,
.quotations-viewport,
.quotations-viewport *,
.modal-overlay,
.modal-overlay *,
.modal-sheet-xl,
.modal-sheet-xl *,
.modal-sheet-large,
.modal-sheet-large *,
.modal-sheet-vitals,
.modal-sheet-vitals *,
.modal-sheet-print,
.modal-sheet-print * {
    font-family: 'Times New Roman', Times, Georgia, serif !important;
}

/* Strictly Times New Roman for VIN / Chassis / Codes / Numbers across UI */
.mono,
.modal-sheet-print .mono,
.printable-quotation-paper .mono,
.po-a4-page .mono {
    font-family: 'Times New Roman', Times, Georgia, serif !important;
    letter-spacing: 0.3px;
}

/* Explicit Brand Logo & Emblem Safeguards to prevent native image blowup across all screens */
.brand-logo-img {
    width: 26px !important;
    height: 26px !important;
    object-fit: contain !important;
    display: block !important;
}

.brand-emblem-badge {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.doc-logo {
    width: 66px !important;
    height: 66px !important;
    object-fit: contain !important;
}

.watermark-logo-img {
    max-width: 440px !important;
    max-height: 440px !important;
    object-fit: contain !important;
    opacity: 0.038 !important;
}

.view-brand-logo {
    height: 38px !important;
    width: auto !important;
    object-fit: contain !important;
}

/* ==========================================================================
   1. VIEWPORT & CONTAINER LAYOUT
   ========================================================================== */
.quotations-viewport {
    padding: 18px 20px;
    height: calc(100vh - 58px);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden !important;
    background-color: #f8fafc;
}

/* Smooth Scrollbar */
.quotations-viewport::-webkit-scrollbar,
.modal-sheet-large::-webkit-scrollbar,
.modal-sheet-vitals::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.quotations-viewport::-webkit-scrollbar-thumb,
.modal-sheet-large::-webkit-scrollbar-thumb,
.modal-sheet-vitals::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

/* ==========================================================================
   2. PAGE HEADER & ACTIONS
   ========================================================================== */
.page-action-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
    gap: 16px;
}

.page-titles .breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
}

.breadcrumbs a {
    color: #2563eb;
    text-decoration: none;
}
.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs .sep {
    color: #94a3b8;
}

.breadcrumbs .current {
    color: #0f172a;
    font-weight: bold;
}

.view-title {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
    letter-spacing: -0.3px;
}

.view-sub {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.header-action-btns {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-action-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
    transition: all 0.2s ease;
}

.btn-action-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.btn-plus {
    font-size: 18px;
    line-height: 1;
}

/* Vitals Pulse Button */
.btn-vitals-pulse {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
    position: relative;
    overflow: hidden;
}

.btn-vitals-pulse:hover {
    background: linear-gradient(135deg, #0f766e, #115e59);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

.btn-vitals-pulse::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 12px;
    width: 6px;
    height: 6px;
    background-color: #34d399;
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 8px #34d399;
    animation: vitalsGlow 1.8s infinite;
}

@keyframes vitalsGlow {
    0%, 100% { opacity: 0.4; transform: translateY(-50%) scale(1); }
    50% { opacity: 1; transform: translateY(-50%) scale(1.6); }
}

.btn-action-outline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background-color: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 9px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action-outline:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

/* ==========================================================================
   3. KPI STRIP
   ========================================================================== */
.quotes-kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.q-kpi-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.q-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.q-kpi-meta .label {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.q-kpi-meta .value {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.text-amber { color: #d97706 !important; }
.text-green { color: #059669 !important; }
.text-blue  { color: #2563eb !important; }

.q-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-blue-subtle  { background-color: #eff6ff; }
.bg-amber-subtle { background-color: #fffbeb; }
.bg-green-subtle { background-color: #ecfdf5; }
.bg-cyan-subtle  { background-color: #f0fdfa; }

/* ==========================================================================
   4. TABLE CONTROLS & FILTER PILLS
   ========================================================================== */
.table-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-status-pills {
    display: flex;
    gap: 6px;
    background-color: #ffffff;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.status-tab {
    background: transparent;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-tab:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.status-tab.active {
    background-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.status-tab.active span {
    color: #ffffff;
}

.table-search-box {
    position: relative;
    width: 380px;
}

.search-mini {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.input-search-table {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    background-color: #ffffff;
    color: #0f172a;
    transition: all 0.2s ease;
}

.input-search-table:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ==========================================================================
   5. DATA TABLE
   ========================================================================== */
.quotes-table-container {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.quotes-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    text-align: left;
    font-size: 12.5px;
}

.quotes-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 700;
    padding: 9px 7px;
    border-bottom: 1px solid #e2e8f0;
    white-space: normal;
    word-break: break-word;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.3px;
    line-height: 1.25;
}

.quotes-table td {
    padding: 9px 7px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.3;
}

.quotes-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Quote ID Badge */
.quote-id-badge {
    font-weight: 700;
    color: #2563eb;
    background-color: #eff6ff;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
    border: 1px solid #dbeafe;
}

/* Phone & WhatsApp Link */
.phone-cell {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.btn-whatsapp-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background-color: #25d366;
    color: #ffffff;
    border-radius: 50%;
    text-decoration: none;
    font-size: 11px;
    transition: transform 0.15s ease;
}
.btn-whatsapp-icon:hover {
    transform: scale(1.15);
}

/* VIN / CHASSIS NUMBER BADGE */
.chassis-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #f1f5f9;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 3px 6px;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 100%;
    word-break: break-all;
}

.chassis-badge:hover {
    background-color: #e2e8f0;
    border-color: #94a3b8;
}

.chassis-badge .copy-icon {
    color: #64748b;
    font-size: 11px;
}

/* Vitals Ref Badge */
.vitals-ref-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: bold;
    max-width: 100%;
    word-break: break-all;
}

.vitals-ref-badge .vitals-dot {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
}

.vitals-none {
    color: #94a3b8;
    font-size: 12px;
    font-style: italic;
}

/* Status Pills */
.tag-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.tag-status.pending {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.tag-status.approved {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.tag-status.converted {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.tag-status.rejected {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Table Row Actions */
.table-action-btns {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

.btn-row-action {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 11px;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 600;
}

.btn-row-action:hover {
    background-color: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-row-action.btn-view {
    color: #2563eb;
    border-color: #bfdbfe;
    background-color: #eff6ff;
}
.btn-row-action.btn-view:hover {
    background-color: #dbeafe;
}

.btn-row-action.btn-convert {
    color: #059669;
    border-color: #a7f3d0;
    background-color: #ecfdf5;
}
.btn-row-action.btn-convert:hover {
    background-color: #d1fae5;
}

.btn-row-action.btn-delete {
    color: #dc2626;
    border-color: #fecaca;
    background-color: #fff5f5;
}
.btn-row-action.btn-delete:hover {
    background-color: #fee2e2;
}

/* ==========================================================================
   6. MODAL OVERLAY & LARGE BUILDER SHEET
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
}

.modal-sheet-large {
    background-color: #ffffff;
    width: 100%;
    max-width: 1050px;
    max-height: 92vh;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.25s ease-out;
}

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

.modal-top-bar {
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background-color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-top-titles h3 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 3px 0;
}

.modal-desc {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.btn-sheet-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.15s ease;
}
.btn-sheet-close:hover {
    color: #0f172a;
}

/* Vitals Quick-Sync Banner */
.vitals-quick-banner {
    background: linear-gradient(135deg, #f0fdfa, #e6fffa);
    border: 1px solid #a7f3d0;
    margin: 18px 24px 8px 24px;
    padding: 12px 18px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.vitals-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vitals-badge-pulse {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #0d9488;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vitals-banner-copy h4 {
    font-size: 14px;
    font-weight: 700;
    color: #0f766e;
    margin: 0 0 2px 0;
}

.vitals-banner-copy p {
    font-size: 12.5px;
    color: #115e59;
    margin: 0;
}

.btn-vitals-import {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #0f766e;
    color: #ffffff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.btn-vitals-import:hover {
    background-color: #115e59;
}

/* Quote Form Body */
.quote-form-body {
    padding: 16px 24px 24px 24px;
}

.form-section-panel {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 18px;
}

.form-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 14px 0;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 6px;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

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

.form-group label {
    font-size: 12.5px;
    font-weight: bold;
    color: #334155;
}

.req {
    color: #ef4444;
}

.form-control {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13.5px;
    color: #0f172a;
    background-color: #ffffff;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

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

.input-with-badge .vin-input {
    padding-right: 75px;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.badge-vin {
    position: absolute;
    right: 8px;
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 3px;
    pointer-events: none;
}

/* Items Table */
.panel-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.btn-subtle-action {
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-subtle-action:hover {
    background-color: #dbeafe;
}

/* ==========================================================================
   SMART QUICK-ADD PANEL (شريط الإدخال السريع والمريح بدون تداخل)
   ========================================================================== */
.quick-add-card {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.quick-add-header-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-add-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 12.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    letter-spacing: 0.2px;
}

.quick-add-hint {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}

.quick-add-grid {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) 110px 115px 75px 115px 135px;
    gap: 10px;
    align-items: flex-end;
}

.items-calc-table .item-labor {
    background: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    color: #166534 !important;
    font-weight: 600;
}
.items-calc-table .item-labor:focus {
    background: #ffffff !important;
    border-color: #16a34a !important;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15) !important;
}

.qa-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.qa-field label {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qa-search-wrap {
    position: relative;
    width: 100%;
}

.qa-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 14px;
    pointer-events: none;
    z-index: 2;
}

.qa-search-wrap input.form-control {
    padding-left: 32px !important;
    padding-right: 36px !important;
    height: 40px !important;
    font-size: 13.5px !important;
    border: 1.5px solid #cbd5e1;
    border-radius: 7px;
    background-color: #ffffff;
    box-sizing: border-box;
}

.qa-search-wrap input.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-qa-trigger {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 28px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 13px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    z-index: 2;
}

.btn-qa-trigger:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.qa-field input.form-control {
    height: 40px !important;
    font-size: 13.5px !important;
    border: 1.5px solid #cbd5e1;
    border-radius: 7px;
    box-sizing: border-box;
}

.btn-quick-add-line {
    height: 40px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-quick-add-line:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.btn-quick-add-line:active {
    transform: translateY(0);
}

/* Quick Catalog Suggestions Dropdown (Spacious & Clean) */
.quick-catalog-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 620px;
    max-width: 90vw;
    max-height: 320px;
    overflow-y: auto;
    background-color: #ffffff;
    border: 1.5px solid #2563eb;
    border-radius: 10px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
    z-index: 10010 !important;
    display: none;
    animation: fadeInDropdown 0.15s ease-out;
}

.quick-catalog-dropdown.show {
    display: block !important;
}

.qa-dd-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background-color: #f8fafc;
    border-bottom: 1.5px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.qa-dd-heading {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0.2px;
}

.qa-dd-browse-link {
    font-size: 12px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.qa-dd-browse-link:hover {
    text-decoration: underline;
}

.qa-dd-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Row Flash Highlight when Added */
@keyframes rowAddedPulse {
    0% { background-color: #dcfce7; }
    50% { background-color: #bbf7d0; }
    100% { background-color: transparent; }
}

.row-added-highlight {
    animation: rowAddedPulse 1.8s ease-out forwards;
}

.items-table-wrap {
    overflow: visible;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 16px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

.items-calc-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.items-calc-table th {
    background-color: #f8fafc;
    color: #334155;
    font-size: 12.5px;
    font-weight: 700;
    padding: 11px 8px;
    border-bottom: 1.5px solid #cbd5e1;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.items-calc-table td {
    padding: 7px 6px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    background-color: #ffffff;
    position: relative;
}

.item-row {
    transition: background-color 0.15s ease;
}

.item-row:hover {
    background-color: #f8fafc;
}

.item-row.dropdown-active,
.item-row.dropdown-active td {
    z-index: 9999 !important;
}

.items-calc-table .form-control {
    width: 100%;
    height: 38px;
    padding: 6px 10px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13.5px;
    color: #0f172a;
    background-color: #ffffff;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.items-calc-table .form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.items-calc-table .item-code {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.items-calc-table .item-price,
.items-calc-table .item-qty {
    font-weight: 600;
}

.items-calc-table .item-total {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    padding-right: 8px;
    white-space: nowrap;
}

.btn-remove-row {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #fef2f2;
    color: #ef4444;
    border: 1.5px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.15s ease;
}

.btn-remove-row:hover {
    background-color: #fee2e2;
    border-color: #f87171;
    color: #b91c1c;
    transform: scale(1.08);
}

/* Totals Strip */
.totals-calculation-strip {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 18px;
}

.notes-input-area label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: #475569;
    margin-bottom: 4px;
}

.notes-input-area textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px;
    font-size: 12.5px;
    resize: vertical;
}

.calculations-table-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    color: #475569;
}

.calc-row-grand {
    border-top: 2px solid #cbd5e1;
    padding-top: 8px;
    font-size: 16px;
    font-weight: bold;
    color: #0f172a;
}

.grand-highlight {
    color: #2563eb;
    font-size: 18px;
    font-weight: bold;
}

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

.calc-input-wrap {
    width: 110px;
}

/* Modal Actions Bar & Sheet Footer */
.modal-actions-bar,
.modal-sheet-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
    margin-top: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.spec-readonly-val {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    color: #0f172a;
    min-height: 38px;
    display: flex;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-builder-row {
    transition: background-color 0.15s ease;
}

.task-builder-row:hover {
    background-color: #f8fafc;
}

.save-actions-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-sheet-secondary {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}
.btn-sheet-secondary:hover {
    background-color: #f1f5f9;
}

.btn-sheet-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    padding: 9px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.btn-sheet-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.btn-sheet-dark {
    background: #0f172a;
    color: #ffffff;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}
.btn-sheet-dark:hover {
    background: #1e293b;
}

/* ==========================================================================
   7. MODAL 2: VITALS INSPECTION REPORT PICKER
   ========================================================================== */
#vitalsPickerModal {
    z-index: 10500 !important;
}

.modal-sheet-vitals {
    background-color: #ffffff;
    width: 100%;
    max-width: 900px;
    max-height: 88vh;
    border-radius: 12px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.25s ease-out;
    position: relative;
    z-index: 10501 !important;
}

.vitals-picker-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: linear-gradient(to bottom, #f0fdfa, #ffffff);
}

.vitals-tag-brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #ccfbf1;
    color: #0f766e;
    font-size: 11.5px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 12px;
    margin-bottom: 6px;
    border: 1px solid #99f6e4;
}

.pulse-indicator {
    width: 6px;
    height: 6px;
    background-color: #0d9488;
    border-radius: 50%;
    box-shadow: 0 0 6px #0d9488;
}

.vitals-picker-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.vitals-picker-header p {
    font-size: 13px;
    color: #475569;
    margin: 0;
}

.vitals-search-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    gap: 14px;
}

.vitals-search-input-wrap {
    position: relative;
    flex: 1;
}

.vitals-search-input-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.input-vitals-search {
    width: 100%;
    padding: 9px 12px 9px 38px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13.5px;
    color: #0f172a;
    background: #ffffff;
}

.input-vitals-search:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.vitals-count-tag {
    font-size: 12.5px;
    font-weight: bold;
    color: #0f766e;
    background-color: #ccfbf1;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.vitals-reports-container {
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

/* Individual Vitals Report Card */
.vitals-report-card {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px;
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vitals-report-card:hover {
    border-color: #0d9488;
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.12);
}

.vitals-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vitals-card-id-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vitals-card-id {
    font-weight: bold;
    color: #0f766e;
    background-color: #ccfbf1;
    border: 1px solid #99f6e4;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.vitals-card-date {
    font-size: 12px;
    color: #64748b;
}

.vitals-card-specs {
    display: grid;
    grid-template-columns: 1.4fr 1.6fr 1fr;
    gap: 12px;
    background-color: #f8fafc;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid #f1f5f9;
}

.vitals-spec-item strong {
    color: #475569;
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

/* Faults Box with matched catalog prices */
.vitals-faults-box {
    background: #fff8f8;
    border: 1.5px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
}

.vitals-faults-title {
    font-size: 12px;
    font-weight: 700;
    color: #991b1b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vitals-faults-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vitals-fault-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #1f2937;
    background: #ffffff;
    padding: 6px 10px;
    border-radius: 5px;
    border: 1px solid #fee2e2;
}

.vitals-fault-name {
    font-weight: 600;
}

.vitals-fault-match {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.vitals-match-badge {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
}

.vitals-fault-price {
    font-weight: 800;
    color: #1d4ed8;
}

.vitals-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    gap: 12px;
    flex-wrap: wrap;
}

.vitals-items-count {
    font-size: 13px;
    color: #475569;
}

.btn-choose-vitals {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #ffffff;
    border: none;
    padding: 9px 20px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-choose-vitals:hover {
    background: linear-gradient(135deg, #0f766e, #115e59);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.vitals-modal-footer {
    padding: 14px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8fafc;
}

.vitals-footer-note {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}

/* ==========================================================================
   8. MODAL 3: PRINTABLE OFFICIAL QUOTATION PAPER
   ========================================================================== */
.modal-sheet-print {
    background-color: #ffffff;
    width: 100%;
    max-width: 900px;
    max-height: 94vh;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   8. MODAL 3: EXECUTIVE A4 QUOTATION PRINT & VIEW
   ========================================================================== */
.modal-sheet-print {
    background-color: #cbd5e1;
    width: 100%;
    max-width: 1020px;
    max-height: 94vh;
    border-radius: 12px;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.35);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-bottom: 40px;
}

/* Executive Controls Bar */
.print-controls-bar {
    padding: 10px 20px;
    background: #ffffff;
    border-bottom: 1px solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.06);
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 12px;
}

.print-meta-info,
.print-meta-left {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.print-preview-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #eef6fb;
    border: 1px solid #b8d7ea;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    color: #1b5d8a;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.preview-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1b5d8a;
    box-shadow: 0 0 6px #1b5d8a;
}

.print-doc-ref,
.print-doc-id {
    font-size: 14px;
    font-weight: 800;
    color: #0e3a59;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.badge-status-print {
    background-color: #10b981;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.badge-status-print.status-pending {
    background-color: #f59e0b;
}

.badge-status-print.status-approved {
    background-color: #10b981;
}

.badge-status-print.status-converted {
    background-color: #6366f1;
}

.badge-status-print.status-rejected {
    background-color: #ef4444;
}

.print-btns-group,
.print-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0;
}

.btn-print-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.btn-print-primary,
.btn-print-pdf {
    background-color: #1b5d8a;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(27, 93, 138, 0.3);
}

.btn-print-primary:hover,
.btn-print-pdf:hover {
    background-color: #134568;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 93, 138, 0.4);
}

.btn-print-pdf-download,
.btn-view-pdf {
    background-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.btn-print-pdf-download:hover,
.btn-view-pdf:hover {
    background-color: #0369a1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

.btn-print-whatsapp {
    background-color: #25d366;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.25);
}

.btn-print-whatsapp:hover {
    background-color: #1eb956;
    transform: translateY(-1px);
}

/* ==========================================================================
   AUTHENTIC A4 PAPER CANVAS & COHESIVE LOGO PALETTE
   ========================================================================== */
.printable-quotation-paper {
    background-color: #ffffff;
    width: 210mm;
    min-height: 297mm;
    max-width: 95%;
    margin: 24px auto 0 auto;
    padding: 14mm 16mm 14mm 16mm;
    color: #0f2942;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08);
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    box-sizing: border-box;
    position: relative;
    font-family: 'Times New Roman', Times, Georgia, serif !important;
    overflow: visible;
}

/* Security Background Watermark Logo (شعار نبض في الخلفية) */
.doc-watermark-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    height: 380px;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    opacity: 0.045;
    display: flex;
    align-items: center;
    justify-content: center;
}

.watermark-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Top Decorative Brand Ribbon */
.doc-top-accent-bar {
    position: relative;
    z-index: 1;
    height: 5px;
    background: linear-gradient(90deg, #1b5d8a 0%, #297fb8 60%, #e1edf5 100%);
    margin: -14mm -16mm 14mm -16mm;
    width: calc(100% + 32mm);
}

/* Document Header (Top Row: Brand on Left, Meta Box on Right) */
.doc-header-top {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.doc-brand {
    display: flex;
    gap: 14px;
    align-items: center;
}

.doc-logo {
    width: 66px;
    height: 66px;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(27, 93, 138, 0.2));
}

.doc-company-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.doc-company-name {
    font-size: 17px;
    font-weight: 800;
    color: #0e3a59;
    margin: 0 0 2px 0;
    letter-spacing: 0.3px;
    line-height: 1.2;
    font-family: 'Times New Roman', Times, Georgia, serif !important;
}

.doc-company-tagline {
    font-size: 11.5px;
    color: #1b5d8a;
    font-weight: 700;
    margin: 0 0 4px 0;
    letter-spacing: 0.2px;
    font-family: 'Times New Roman', Times, Georgia, serif !important;
}

/* Identical Line & Font for Phone and Location (في نفس الخط ونفس السطر تماماً) */
.doc-contact-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px !important;
    color: #334155 !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    font-family: 'Times New Roman', Times, Georgia, serif !important;
    line-height: 1.2 !important;
}

.doc-contact-line .contact-entry,
.doc-contact-line span {
    font-family: 'Times New Roman', Times, Georgia, serif !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    white-space: nowrap !important;
    vertical-align: middle;
}

.doc-contact-line .contact-divider {
    color: #94a3b8 !important;
    font-size: 11px !important;
}

/* Header Meta Box (Compact 2x2 Grid) */
.doc-header-meta-box {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 4px 16px;
    background: #f8fbfe;
    border: 1px solid #d0e2ee;
    padding: 7px 14px;
    border-radius: 4px;
}

.meta-card-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 11.5px;
    white-space: nowrap !important;
}

.meta-card-lbl {
    font-weight: 700;
    color: #475569;
}

.meta-card-val {
    color: #0f172a;
}

.text-brand {
    color: #1b5d8a !important;
}

.badge-vitals-ref {
    background-color: #e0f2fe;
    color: #0369a1;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 3px;
    border: 1px solid #bae6fd;
    font-size: 10.5px;
}

/* ==========================================================================
   DEDICATED FULL-WIDTH SINGLE-LINE "OFFICIAL QUOTATION" TITLE BAR
   ========================================================================== */
.doc-title-single-line-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 10px 0 16px 0;
    width: 100%;
    white-space: nowrap !important;
}

.title-decor-line {
    flex: 1;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, #2478ba 50%, transparent);
}

.doc-type-title {
    font-size: 21px;
    font-weight: 900;
    color: #1b5d8a;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    margin: 0;
    padding: 0 8px;
    white-space: nowrap !important;
    line-height: 1;
    text-align: center;
}

/* ==========================================================================
   CUSTOMER & VEHICLE SPECIFICATIONS (HARMONIZED 2-COL GRID)
   ========================================================================== */
.doc-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.specs-card {
    background-color: #f8fbfe;
    border: 1px solid #d0e2ee;
    border-top: 3px solid #1b5d8a;
    border-radius: 4px;
    overflow: hidden;
}

.specs-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: #eef5fa;
    border-bottom: 1px solid #d0e2ee;
}

.specs-header-icon {
    font-size: 13px;
}

.specs-title {
    font-size: 11.5px;
    font-weight: 800;
    color: #0e3a59;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.specs-card-body {
    padding: 9px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spec-field-row {
    display: flex;
    align-items: baseline;
    font-size: 12.5px;
    line-height: 1.35;
}

.spec-label {
    width: 112px;
    flex-shrink: 0;
    font-weight: 700;
    color: #475569;
    font-size: 11.5px;
}

.spec-value {
    color: #0f2942;
    flex-grow: 1;
}

.spec-vin-highlight-row {
    background: #ffffff;
    border: 1px solid #b8d7ea;
    border-radius: 3px;
    padding: 2.5px 6px;
    margin: 1px -6px;
}

.spec-value-vin {
    color: #1b5d8a;
    font-size: 12.5px;
    font-weight: bold;
    letter-spacing: 0.4px;
}

/* ==========================================================================
   DOCUMENT ITEMS & LABOR TABLE (NAVY HEADERS & PRECISE NUMBERS)
   ========================================================================== */
.doc-table-wrap {
    margin-bottom: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    overflow: hidden;
}

.doc-items-table {
    width: 100%;
    border-collapse: collapse;
}

.doc-items-table th {
    background-color: #134568 !important;
    color: #ffffff !important;
    font-size: 11px;
    font-weight: 800;
    padding: 7px 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: none;
    white-space: nowrap !important;
}

.doc-items-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12.5px;
    color: #1e293b;
    white-space: nowrap !important;
    vertical-align: middle;
}

.doc-items-table tr:nth-child(even) td {
    background-color: #f8fbfe;
}

.doc-items-table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   FINANCIAL BREAKDOWN & NOTES STRIP
   ========================================================================== */
.doc-financial-strip {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.doc-notes-card {
    background-color: #f8fbfe;
    border: 1px solid #d0e2ee;
    border-radius: 4px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
}

.doc-notes-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.doc-notes-head .notes-icon {
    font-size: 12px;
}

.doc-notes-head h4 {
    font-size: 11px;
    font-weight: 800;
    color: #1b5d8a;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin: 0;
}

.doc-notes-content p {
    font-size: 11.5px;
    color: #334155;
    line-height: 1.45;
    margin: 0;
}

.doc-summary-card {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sum-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
    color: #475569;
}

.sum-lbl {
    font-weight: 600;
}

.sum-val {
    font-size: 12px;
    color: #0f172a;
}

.sum-row-grand {
    margin-top: 6px;
    padding: 8px 10px;
    background: linear-gradient(135deg, #1b5d8a 0%, #134568 100%);
    color: #ffffff;
    border-radius: 3px;
    font-size: 13.5px;
    font-weight: bold;
}

.sum-row-grand .sum-lbl {
    color: #ffffff;
    font-size: 12.5px;
    letter-spacing: 0.5px;
}

.sum-row-grand .sum-val {
    color: #ffffff;
    font-size: 15px;
}

/* ==========================================================================
   SIGNATURES & CERTIFIED ELECTRONIC STAMP (ULTRA-PROFESSIONAL)
   ========================================================================== */
.doc-signatures-strip {
    display: grid;
    grid-template-columns: 1fr 1fr 150px;
    gap: 16px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
    align-items: flex-end;
}

.sig-block {
    text-align: center;
}

.sig-line {
    border-bottom: 1.5px solid #94a3b8;
    height: 42px;
    margin-bottom: 6px;
}

.sig-name {
    display: block;
    font-size: 11.5px;
    font-weight: 800;
    color: #0e3a59;
}

.sig-role {
    display: block;
    font-size: 10px;
    color: #64748b;
    font-style: italic;
}

.sig-stamp-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.official-electronic-stamp {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
    pointer-events: none;
    margin-bottom: 2px;
}

.emblem-only-stamp {
    width: 110px;
    height: 110px;
    transform: rotate(-3deg);
    filter: drop-shadow(0 2px 6px rgba(36, 112, 162, 0.28));
    background: transparent !important;
    border: none !important;
}

.stamp-emblem-clean {
    width: 100px;
    height: 100px;
    object-fit: contain;
    opacity: 0.94;
    display: block;
}

.stamp-caption {
    display: block;
    font-size: 9.5px;
    font-weight: 800;
    color: #2478ba;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 2px;
    text-align: center;
    font-family: 'Times New Roman', Times, Georgia, serif !important;
}

/* ==========================================================================
   9. STRICT A4 & MULTI-PAGE PRINT MEDIA RULES (1 A4 OR 2 A4 PAGES CLEANLY)
   ========================================================================== */
@media print {
    @page {
        size: A4 portrait;
        margin: 8mm 10mm 10mm 10mm !important;
    }

    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100% !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Hide entire UI app layout during print */
    .app-layout,
    .app-sidebar,
    .app-topbar,
    .quotations-viewport,
    .print-controls-bar,
    .po-modal-noprint,
    .sidebar-backdrop,
    .quote-view-topbar,
    .modal-overlay:not(#printViewModal):not(#printWorkOrderModal):not(#printQcModal):not(#paymentOrderPrintModal),
    #quoteModal,
    #vitalsPickerModal,
    #catalogModal,
    #catalogPickerModal,
    #whatsappDispatchModal,
    #jobCardModal,
    #workOrderModal,
    #technicianModal,
    #assignTechModal,
    #editOpsModal,
    #editOperationsModal,
    #dispatchTechModal,
    #addTechnicianModal,
    #techDirectoryModal,
    #woPickerModal,
    #qcInspectionModal,
    #invoiceModal,
    #suppliersModal,
    #qcModal {
        display: none !important;
    }

    #printViewModal,
    #printWorkOrderModal,
    #printQcModal,
    #paymentOrderPrintModal {
        display: block !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    .modal-sheet-print {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    .quote-view-container {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    #printableQuotationPaper,
    #printableJobCardPaper,
    #printableWorkOrderPaper,
    #printableQcPaper,
    #printablePaymentOrderSheet,
    .po-a4-page,
    .printable-quotation-paper {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        padding: 0 !important;
        margin: 0 auto !important;
        border: none !important;
        box-shadow: none !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        page-break-after: auto !important;
        page-break-inside: auto !important;
    }

    /* Multi-Page Table & Flow Control: If items exceed 1 A4, flows cleanly to Page 2 */
    table,
    .doc-items-table,
    .doc-operations-table {
        width: 100% !important;
        border-collapse: collapse !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
    }

    thead {
        display: table-header-group !important; /* Repeats table header cleanly on Page 2 */
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    tbody {
        page-break-inside: auto !important;
        break-inside: auto !important;
    }

    tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* Page 1 Document Header Blocks */
    .doc-top-accent-bar,
    .doc-header-top,
    .doc-title-single-line-bar,
    .doc-specs-grid,
    .doc-meta-card {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* Totals, Terms, Signatures & Footer Blocks */
    .doc-totals-and-terms,
    .doc-financial-strip,
    .doc-summary-card,
    .doc-notes-card,
    .doc-signatures-strip,
    .doc-signatures-box,
    .doc-terms-box,
    .doc-terms-block,
    .doc-warranty-badge-box,
    .doc-bottom-meta-row,
    .doc-notes-callout,
    .doc-footer-legal {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .doc-top-accent-bar {
        margin: -8mm -12mm 6mm -12mm !important;
        width: calc(100% + 24mm) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .doc-header-top {
        margin-bottom: 8px !important;
    }

    .doc-title-single-line-bar {
        margin-bottom: 8px !important;
    }

    .doc-specs-grid {
        margin-bottom: 8px !important;
        gap: 10px !important;
    }

    .specs-card-body {
        padding: 5px 8px !important;
    }

    .doc-table-wrap {
        margin-bottom: 8px !important;
    }

    .doc-items-table th {
        padding: 4px 6px !important;
        font-size: 10px !important;
    }

    .doc-items-table td {
        padding: 4px 6px !important;
        font-size: 11px !important;
    }

    .doc-financial-strip {
        margin-bottom: 8px !important;
        gap: 10px !important;
    }

    .doc-notes-card,
    .doc-summary-card {
        padding: 5px 8px !important;
    }

    .doc-signatures-strip {
        margin-top: 4px !important;
        padding-top: 4px !important;
    }

    .stamp-emblem-clean {
        height: 75px !important;
        width: auto !important;
    }

    .doc-watermark-bg {
        display: flex !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 380px !important;
        height: 380px !important;
        opacity: 0.05 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        z-index: 0 !important;
    }

    .official-electronic-stamp,
    .emblem-only-stamp,
    .stamp-emblem-clean {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .doc-items-table th {
        background-color: #134568 !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .sum-row-grand {
        background: #1b5d8a !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .specs-card {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .specs-card-header {
        background-color: #eef5fa !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .doc-notes-card {
        background-color: #f8fbfe !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ==========================================================================
   10. AUTOCOMPLETE DROPDOWN & PRICE CATALOG MANAGEMENT (إدارة قائمة الأسعار)
   ========================================================================== */
.autocomplete-cell-wrap {
    position: relative;
    width: 100%;
}

.item-row.dropdown-active .autocomplete-cell-wrap {
    z-index: 10000 !important;
}

.autocomplete-cell-wrap .item-name {
    width: 100%;
    padding-right: 32px;
}

.btn-cat-trigger {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.15s ease;
    z-index: 2;
}

.btn-cat-trigger:hover {
    background-color: #f1f5f9;
    color: #2563eb;
}

/* Floating Catalog Dropdown Menu */
.catalog-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 520px;
    max-width: 90vw;
    max-height: 290px;
    overflow-y: auto;
    background-color: #ffffff;
    border: 1.5px solid #2563eb;
    border-radius: 8px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.22);
    z-index: 10001 !important;
    display: none;
    animation: fadeInDropdown 0.15s ease-out;
}

.catalog-dropdown-menu.drop-up {
    top: auto !important;
    bottom: calc(100% + 4px) !important;
    box-shadow: 0 -14px 35px rgba(15, 23, 42, 0.22) !important;
    animation: fadeInDropUp 0.15s ease-out;
}

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

.catalog-dropdown-menu.show {
    display: block !important;
}

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

.cat-dd-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11.5px;
    color: #64748b;
}

.cat-dd-manage-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}
.cat-dd-manage-link:hover {
    text-decoration: underline;
}

.cat-dd-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cat-dd-item {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: background-color 0.15s ease;
}

.cat-dd-item:hover,
.cat-dd-item.selected {
    background-color: #eff6ff;
}

.cat-dd-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cat-dd-item-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-dd-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-code-badge {
    background-color: #f1f5f9;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}

.cat-cat-badge {
    color: #0f766e;
    background-color: #ccfbf1;
    border: 1px solid #99f6e4;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
    flex-shrink: 0;
}

.cat-notes-text {
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-dd-item-price {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.cat-price-pill {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: 800;
    font-size: 13px;
    white-space: nowrap;
}

.cat-labor-hint {
    display: block;
    font-size: 10.5px;
    color: #64748b;
    white-space: nowrap;
}

.cat-dd-empty {
    padding: 22px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

/* ==========================================================================
   11. CATALOG MANAGEMENT MODAL SHEET
   ========================================================================== */
.catalog-sheet {
    max-width: 1080px;
}

.catalog-badge-top {
    display: inline-block;
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.catalog-modal-body {
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.catalog-form-panel {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
}

.catalog-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.catalog-form-header h4 {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.catalog-form-tip {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}

.cat-form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.cat-span-2 {
    grid-column: span 2;
}

.cat-form-actions {
    grid-column: span 4;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

/* Catalog Table Section */
.catalog-table-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.catalog-search-wrap {
    position: relative;
    flex: 1;
}

.catalog-search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.catalog-meta-strip {
    display: flex;
    align-items: center;
    gap: 10px;
}

.catalog-counter {
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
}

/* Category Filter Pills */
.cat-category-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cat-pill {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cat-pill:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.cat-pill.active {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.catalog-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow-x: auto;
    max-height: 420px;
    background: #ffffff;
}

.catalog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.catalog-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: bold;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 2;
}

.catalog-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

.catalog-table tbody tr:hover {
    background-color: #f8fafc;
}

.btn-catalog-action {
    background-color: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}
.btn-catalog-action:hover {
    background-color: #dcfce7;
}

.btn-manage-catalog-action {
    background-color: #faf5ff;
    color: #7e22ce;
    border-color: #e9d5ff;
}
.btn-manage-catalog-action:hover {
    background-color: #f3e8ff;
}

/* ==========================================================================
   12. STRICT SINGLE-LINE TABLES & MULTI-SCREEN RESPONSIVENESS
   ========================================================================== */

/* Universal Single-Line Table Enforcement Across All Tables */
table,
table th,
table td,
.quotes-table th,
.quotes-table td,
.catalog-table th,
.catalog-table td,
.items-calc-table th,
.items-calc-table td,
#quickPickerTable th,
#quickPickerTable td,
.doc-items-table th,
.doc-items-table td {
    white-space: nowrap !important;
}

/* Zero Horizontal Scroll Containers */
.quotes-table-container,
.catalog-table-wrap,
.picker-table-wrap,
.items-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
}

/* Ensure tables fit 100% of viewport without horizontal scrolling */
.quotes-table,
.catalog-table,
#quickPickerTable,
.items-calc-table,
.doc-items-table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
}

/* Inputs & Badges inside Table Cells */
.items-calc-table input,
.quotes-table input,
.catalog-table input {
    white-space: nowrap !important;
}

.table-action-btns,
.phone-cell,
.chassis-badge,
.tag-status,
.vitals-ref-badge,
.quote-id-badge,
.cat-price-pill,
.cat-code-badge {
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center;
    flex-shrink: 0;
}

/* Text ellipsis for table cells where needed */
.cell-ellipsis {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
    display: inline-block;
    vertical-align: middle;
}

/* ==========================================================================
   MULTI-DEVICE RESPONSIVE BREAKPOINTS (ALL SCREENS COMPATIBILITY)
   ========================================================================== */

/* 1. Large Displays & Desktop Adaptations (> 1200px) */
@media (min-width: 1201px) {
    .quotes-kpi-strip {
        grid-template-columns: repeat(4, 1fr);
    }
    .form-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    .cat-form-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 2. Laptops & Medium Screens (992px - 1200px) */
@media (max-width: 1200px) {
    .quotations-viewport {
        padding: 20px 24px;
    }
    .quotes-kpi-strip {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .form-grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .cat-form-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .table-search-box {
        width: 320px;
    }
    .modal-sheet-large,
    .modal-sheet-vitals,
    .modal-sheet-print,
    .catalog-sheet {
        max-width: 95vw;
    }
}

/* 3. Tablets & Small Laptops (768px - 991px) */
@media (max-width: 991px) {
    .quotations-viewport {
        padding: 16px 20px;
        height: calc(100vh - 58px);
    }
    
    .page-action-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .header-action-btns {
        flex-wrap: wrap;
        width: 100%;
        gap: 8px;
    }

    .header-action-btns button {
        flex: 1 1 170px;
        justify-content: center;
    }

    .quotes-kpi-strip {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .table-controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .table-search-box {
        width: 100%;
    }

    .filter-status-pills {
        overflow-x: auto;
        width: 100%;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding: 4px;
    }

    .totals-calculation-strip {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .calculations-table-box {
        max-width: 420px;
        margin-left: auto;
    }

    .vitals-card-specs {
        grid-template-columns: 1fr 1fr;
    }
}

/* 4. Mobile Phones (< 768px) */
@media (max-width: 767px) {
    .quotations-viewport {
        padding: 12px 14px;
        height: calc(100vh - 58px);
    }

    .view-title {
        font-size: 20px;
    }

    .view-sub {
        font-size: 12px;
    }

    .page-action-header {
        margin-bottom: 16px;
    }

    .header-action-btns {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .header-action-btns button {
        width: 100%;
        justify-content: center;
        padding: 10px 14px;
    }

    .quotes-kpi-strip {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 16px;
    }

    .q-kpi-card {
        padding: 12px 16px;
    }

    .q-kpi-meta .value {
        font-size: 20px;
    }

    .table-controls-bar {
        margin-bottom: 12px;
    }

    /* Fullscreen Modern Sheet for Mobile */
    .modal-overlay {
        padding: 0 !important;
    }

    .modal-sheet-large,
    .modal-sheet-vitals,
    .modal-sheet-print,
    .catalog-sheet {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }

    .modal-top-bar,
    .vitals-picker-header {
        padding: 14px 16px;
    }

    .quote-form-body,
    .catalog-modal-body {
        padding: 14px 16px 24px 16px;
    }

    .form-grid-4,
    .cat-form-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .cat-span-2 {
        grid-column: span 1 !important;
    }

    .cat-form-actions {
        grid-column: span 1 !important;
        flex-direction: column;
        width: 100%;
    }

    .cat-form-actions button {
        width: 100%;
    }

    .vitals-quick-banner {
        margin: 12px 16px 4px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .quick-add-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px;
    }
    .qa-field-name {
        grid-column: span 2 !important;
    }
    .qa-field-submit {
        grid-column: span 2 !important;
    }
    .quick-catalog-dropdown {
        width: 100% !important;
        max-width: 100% !important;
    }

    .items-table-wrap {
        overflow-x: hidden !important;
    }
    .items-calc-table {
        min-width: 0 !important;
        width: 100% !important;
    }

    .btn-vitals-import {
        width: 100%;
        justify-content: center;
    }

    .vitals-card-specs {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .vitals-card-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .btn-choose-vitals {
        width: 100%;
        text-align: center;
    }

    .modal-actions-bar {
        flex-direction: column-reverse;
        gap: 10px;
        width: 100%;
    }

    .modal-actions-bar button,
    .save-actions-group {
        width: 100%;
    }

    .save-actions-group {
        flex-direction: column;
        gap: 8px;
    }

    .catalog-dropdown-menu {
        width: calc(100vw - 32px) !important;
        max-width: 380px !important;
        left: 0 !important;
    }

    .catalog-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .catalog-meta-strip {
        justify-content: space-between;
    }

    .doc-specs-grid,
    .doc-financial-strip,
    .doc-signatures-strip {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    .doc-header {
        flex-direction: column;
        gap: 16px;
    }

    .doc-quote-meta {
        text-align: left;
    }

    .printable-quotation-paper {
        padding: 20px 16px;
    }
}

/* ==========================================================================
   10. WHATSAPP A4 FORMAT DISPATCH MODAL STYLING
   ========================================================================== */
.modal-sheet-whatsapp {
    background-color: #ffffff;
    width: 100%;
    max-width: 620px;
    border-radius: 8px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Times New Roman', Times, Georgia, serif !important;
}

.wa-modal-header {
    background: linear-gradient(135deg, #075e54, #128c7e);
    color: #ffffff;
    padding: 16px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wa-header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.wa-icon-bubble {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wa-badge-top {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #a7f3d0;
    font-weight: bold;
    margin-bottom: 2px;
}

.wa-modal-title {
    margin: 0;
    font-size: 17px;
    font-weight: bold;
    color: #ffffff;
}

.wa-modal-body {
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #ffffff;
}

.wa-quote-summary-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wa-summary-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wa-summary-quote-id {
    font-size: 13.5px;
    font-weight: bold;
    color: #065f46;
}

.wa-summary-customer {
    font-size: 14.5px;
    font-weight: bold;
    color: #0f172a;
}

.wa-summary-vehicle {
    font-size: 12px;
    color: #475569;
}

.wa-summary-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.wa-summary-lbl {
    font-size: 11px;
    text-transform: uppercase;
    color: #059669;
    font-weight: bold;
}

.wa-summary-val {
    font-size: 17px;
    font-weight: bold;
    color: #065f46;
}

.wa-a4-pill {
    background: #047857;
    color: #ffffff;
    font-size: 10.5px;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: bold;
}

.wa-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wa-input-lbl {
    font-size: 12.5px;
    font-weight: bold;
    color: #334155;
}

.wa-phone-row {
    display: flex;
    gap: 8px;
}

.btn-wa-copy {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-wa-copy:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.wa-help-text {
    font-size: 11.5px;
    color: #64748b;
    word-break: break-all;
}

.wa-msg-textarea {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: #1e293b;
    resize: none;
    line-height: 1.4;
}

.wa-actions-grid {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 4px;
}

.btn-wa-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-wa-send {
    background: #25d366;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(37, 211, 102, 0.35);
}

.btn-wa-send:hover {
    background: #1eb956;
    transform: translateY(-1px);
}

.btn-wa-pdf {
    background: #1b5d8a;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(27, 93, 138, 0.3);
}

.btn-wa-pdf:hover {
    background: #134568;
    transform: translateY(-1px);
}

.btn-wa-dual {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.35);
}

.btn-wa-dual:hover {
    background: linear-gradient(135deg, #0f766e, #115e59);
    transform: translateY(-1px);
}

.wa-modal-footer {
    padding: 14px 24px;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wa-footer-tip {
    font-size: 11.5px;
    color: #64748b;
}

@media print {
    #whatsappDispatchModal {
        display: none !important;
    }
}



