/* Shared A4 contract for the design canvas (#a4Canvas) and the paginated sheets (.quote-sheet) used by
   the quote preview, public link, PDF capture and browser print. */
:root{--quote-paper-width:210mm;--quote-paper-height:297mm;--quote-paper-px-width:794px;--quote-paper-px-height:1122px}
:is(#a4Canvas,#coverCanvas,.quote-sheet){font-family:Arial,Helvetica,sans-serif;font-size:16px;line-height:1.5;font-weight:400;color:#1e293b;text-align:left;box-sizing:border-box;width:794px;height:1122px;min-width:794px;max-width:794px;max-height:1122px;position:relative;overflow:hidden;background:#fff;transform:none}
:is(#a4Canvas,.quote-sheet) .quote-items-table{width:100%;max-width:100%;table-layout:fixed;border-collapse:collapse}
:is(#a4Canvas,.quote-sheet) .quote-items-table th,:is(#a4Canvas,.quote-sheet) .quote-items-table td{overflow-wrap:anywhere;word-break:normal}
:is(#a4Canvas,.quote-sheet) .quote-items-table thead th{background-color:#c8102e!important;color:#fff!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
:is(#a4Canvas,.quote-sheet) .quote-items-table th:last-of-type{white-space:normal}
:is(#a4Canvas,.quote-sheet) .drag-widget{box-sizing:border-box;overflow-wrap:anywhere;word-break:normal}
.quote-sheet .drag-widget{outline:none!important;box-shadow:none!important;border-color:transparent}
.quote-sheet *{-webkit-print-color-adjust:exact;print-color-adjust:exact}

/* Screen layout of the generated pages (editor preview and public link). */
.quote-pages{display:flex;flex-direction:column;align-items:center;gap:18px;width:100%}
.quote-pages .quote-page{flex:none;margin:0;box-shadow:0 2px 16px rgba(15,23,42,.14);transform-origin:top left}
.quote-page-slot{flex:none;overflow:hidden}

@media print{
 @page{size:A4 portrait;margin:0}
 html,body{width:210mm!important;min-width:0!important;margin:0!important;padding:0!important;background:#fff!important}
 body *{visibility:hidden!important}
 .quote-pages,.quote-pages *{visibility:visible!important}
 .quote-pages{display:block!important;position:absolute!important;left:0!important;top:0!important;width:210mm!important;gap:0!important}
 .quote-page-slot{width:210mm!important;height:297mm!important;overflow:hidden!important;break-after:page;page-break-after:always}
 .quote-page-slot:last-child{break-after:auto;page-break-after:auto}
 .quote-page{zoom:1!important;transform:none!important;box-shadow:none!important;margin:0!important;border:0!important;border-radius:0!important}
 .quote-sheet .no-print{display:none!important}
 .quote-sheet table,.quote-sheet tr,.quote-sheet td,.quote-sheet th{break-inside:avoid!important;page-break-inside:avoid!important}
}

/* In the quote creation view the template is preview-only; edit items in the item list. */
#tab1 #a4Canvas .drag-widget{pointer-events:none!important}
/* Shared table rendering for editor preview, public link, PDF and print. */
:is(#a4Canvas,.quote-sheet) .drag-widget table{width:100%!important;max-width:100%!important;table-layout:fixed!important;border-collapse:collapse!important;font-family:Arial,Helvetica,sans-serif!important}
:is(#a4Canvas,.quote-sheet) .quote-items-table th,:is(#a4Canvas,.quote-sheet) .quote-items-table td{padding:4px 5px!important;overflow-wrap:anywhere;word-break:break-word;white-space:normal!important;vertical-align:top;border:1px solid #dee2e6}
:is(#a4Canvas,.quote-sheet) .quote-items-table thead th{background:#c8102e!important;color:#fff!important;font-weight:700!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
#a4Canvas .quote-items-table tbody tr:nth-child(even){background:#f8f9fa}

/* Teklif Kapağı tasarım tuvali */
#coverCanvas{padding:0!important;border-radius:0}
#coverCanvas .cover-widget{outline:1px dashed #94a3b8;outline-offset:0;white-space:pre-wrap;overflow:hidden;overflow-wrap:anywhere;box-shadow:none}
#coverCanvas .cover-widget.selected-widget{outline:2px solid #c8102e}
#coverCanvas .cover-widget.cover-image-empty{background-color:#e2e8f0!important}
#coverCanvas .cover-widget.cover-image-empty::after{content:attr(title);display:block;padding:6px;font-size:12px;color:#64748b}
.quote-cover .cover-item{overflow-wrap:anywhere}
