/* Teklif editörü ve A4 çıktısı */
.qbar{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px 16px;margin:0 0 14px;display:flex;flex-wrap:wrap;gap:12px 16px;align-items:center;justify-content:space-between;max-width:860px;margin-left:auto;margin-right:auto}
.qbar-title b{display:block;font-size:17px}
.qbar-title small{color:var(--muted);font-size:13px}
.qbar-ctl{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.qbar button{padding:8px 13px;font-size:14px}
.inl{display:flex;align-items:center;gap:6px;font-size:14px;color:var(--muted)}
.inl select{font:600 14px var(--body);padding:7px 9px;border-radius:9px;border:1px solid var(--line);background:var(--surface);color:var(--ink)}
.qbar.cols{justify-content:flex-start;gap:10px 18px}
.ct-title{font-size:14px;color:var(--muted);font-weight:600}
.sw{display:flex;align-items:center;gap:7px;font-size:14px;cursor:pointer;user-select:none}
.sw input{position:absolute;opacity:0;width:0;height:0}
.sw i{position:relative;width:34px;height:20px;border-radius:999px;background:#E3CDB5;transition:background-color .15s;flex-shrink:0}
.sw i::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.3);transition:left .15s}
.sw input:checked+i{background:var(--accent)}
.sw input:checked+i::after{left:16px}
.sw input:focus-visible+i{outline:3px solid var(--accent);outline-offset:2px}

.page-tabs{display:flex;gap:8px;max-width:860px;margin:0 auto 0}
.page-tab{padding:8px 16px;border-radius:10px 10px 0 0;font-size:14px;background:#F6E3CE;border:1px solid var(--line);border-bottom:0;color:var(--muted)}
.page-tab.active{background:#fff;color:var(--ink);font-weight:600}

/* ---------- A4 sayfa ---------- */
.sheet{--sheet-ink:#1c1c1e;--sheet-soft:#55565c;--sheet-line:#d8dadf;--sheet-acc:#1e4fd6;
  max-width:860px;margin:0 auto 24px;background:#fff;color:var(--sheet-ink);border:1px solid var(--line);border-radius:0 10px 10px 10px;
  padding:46px 56px 40px;min-height:1120px;display:flex;flex-direction:column;box-shadow:0 10px 30px rgba(20,22,30,.08);font-family:"Segoe UI",Arial,sans-serif}
.sheet.hidden-screen{display:none}
.head-row{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:8px;gap:16px}
.logo-wrap img{height:56px;max-width:260px;object-fit:contain;display:block}
.logo-text{font-size:20px;font-weight:700;letter-spacing:-.01em;padding-top:8px}
.date-wrap{text-align:right;font-size:13.5px;color:var(--sheet-soft);padding-top:6px}
.date-wrap input[type=date]{border:1px solid transparent;background:transparent;font:13.5px "Segoe UI",Arial,sans-serif;color:var(--sheet-soft);text-align:right;padding:2px 4px;border-radius:5px;width:auto}
.date-wrap input[type=date]:hover,.date-wrap input[type=date]:focus{border-color:var(--sheet-line);background:#fafbfc;outline:none}
.recipient{text-align:center;margin:26px 0 14px;font-size:15px;line-height:1.55}
.recipient .sn{color:var(--sheet-soft)}
.recipient [contenteditable]{display:inline-block;min-width:40px;border-bottom:1px dashed transparent;padding:0 2px;outline:none;font-weight:600}
.recipient [contenteditable]:empty::before{content:attr(data-ph);color:#9aa0ab;font-weight:400}
.recipient [contenteditable]:hover,.recipient [contenteditable]:focus{border-bottom-color:#9aa0ab;background:#fafbfc}
.intro-text{text-align:center;font-size:13.5px;color:var(--sheet-soft);line-height:1.5;margin:0 0 26px;padding:2px 8px;border-radius:5px;outline:none;border:1px dashed transparent}
.intro-text:hover,.intro-text:focus{border-color:#9aa0ab;background:#fafbfc}

table.quote-table{width:100%;border-collapse:collapse;margin-top:6px;font-size:13.5px;table-layout:fixed}
table.quote-table thead th{background:var(--sheet-acc);color:#fff;font-weight:600;text-align:left;padding:9px 10px;font-size:12.5px;letter-spacing:.2px;position:static;white-space:normal}
table.quote-table thead th.num,table.quote-table td.num{text-align:right;font-variant-numeric:tabular-nums}
table.quote-table tbody td{padding:7px 10px;border-bottom:1px solid var(--sheet-line);vertical-align:middle;white-space:normal;background:transparent}
table.quote-table tbody tr:nth-child(even) td{background:#fafbfc}
table.quote-table td[contenteditable]{outline:none;min-height:18px}
table.quote-table td[contenteditable]:focus,table.quote-table td[contenteditable]:hover{background:#eef2ff;border-radius:4px}
.c-qty{width:8%}.c-cur{width:11%}.c-price{width:15%}.c-disc{width:13%}.c-total{width:15%}.c-act{width:34px}
.col-hidden{display:none!important}
input.cell-name,input.num-input{border:1px solid transparent;background:transparent;font:13.5px "Segoe UI",Arial,sans-serif;color:var(--sheet-ink);border-radius:4px;width:100%;outline:none;padding:4px 5px}
input.cell-name{padding-right:22px;text-overflow:ellipsis;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1L5 5L9 1' stroke='%239aa0ab' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");background-repeat:no-repeat;background-position:right 6px center}
input.num-input{text-align:right;font-variant-numeric:tabular-nums}
input.cell-name:hover,input.cell-name:focus,input.num-input:hover,input.num-input:focus{background-color:#eef2ff;border-color:var(--sheet-line)}
.cell-name-print{display:none}
select.cell-currency{border:1px solid transparent;background:transparent;font:13.5px "Segoe UI",Arial,sans-serif;color:var(--sheet-ink);padding:3px 4px;border-radius:5px;cursor:pointer;width:100%}
select.cell-currency:hover:not(:disabled),select.cell-currency:focus{background:#eef2ff;border-color:var(--sheet-line);outline:none}
select.cell-currency:disabled{color:var(--sheet-ink);opacity:1;cursor:default;appearance:none;-webkit-appearance:none;background-image:none}
td.actions-col,th.actions-col{width:34px;text-align:center;padding:4px!important}
button.icon-btn{border:0;background:transparent;color:#b5333a;font-size:16px;line-height:1;padding:4px 6px;border-radius:5px}
button.icon-btn:hover:not(:disabled){background:#fbe7e8}

.summary-block{width:290px;margin-left:auto;margin-top:4px;font-size:13.5px}
.summary-block .srow{display:flex;justify-content:space-between;padding:7px 10px;border-bottom:1px solid var(--sheet-line)}
.summary-block .srow span:first-child{color:var(--sheet-soft)}
.summary-block .srow span:last-child{font-variant-numeric:tabular-nums}
.summary-block .srow.total{background:var(--sheet-acc);color:#fff;font-weight:700;border-radius:0 0 6px 6px;border-bottom:0}
.summary-block .srow.total span{color:#fff}
.spacer{flex:1}
.rt-wrap{flex:1;display:flex;flex-direction:column;margin-top:14px;min-height:150px}
.rt-bar{display:flex;flex-wrap:wrap;align-items:center;gap:5px;padding:6px;border:1px solid var(--sheet-line);border-bottom:0;border-radius:8px 8px 0 0;background:#fafbfc;font-family:"Segoe UI",Arial,sans-serif}
.rt-bar select{font:13px "Segoe UI",Arial,sans-serif;padding:4px 6px;border:1px solid var(--sheet-line);border-radius:6px;background:#fff;color:var(--sheet-ink);max-width:130px}
.rt-b{min-width:30px;padding:4px 8px!important;font:13px "Segoe UI",Arial,sans-serif!important;border-radius:6px!important;background:#fff;color:var(--sheet-ink);border:1px solid var(--sheet-line)!important}
.rt-b:hover:not(:disabled){background:#eef2ff!important;border-color:#9aa0ab!important}
.rt-color{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;width:30px;height:28px;border:1px solid var(--sheet-line);border-radius:6px;background:#fff;cursor:pointer;position:relative;overflow:hidden}
.rt-color span{font:700 13px "Segoe UI",Arial,sans-serif;line-height:1;color:var(--sheet-ink)}
.rt-color input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer;padding:0;border:0}
.rt-sep{width:1px;height:20px;background:var(--sheet-line);margin:0 2px}
.rt-box{flex:1;min-height:120px;border:1px solid var(--sheet-line);border-radius:0 0 8px 8px;padding:10px 12px;outline:none;font:10pt/1.5 "Segoe UI",Arial,sans-serif;color:var(--sheet-ink);overflow-wrap:anywhere}
.rt-box:focus{border-color:#9aa0ab}
.rt-box:empty::before{content:attr(data-ph);color:#9aa0ab}
.rt-box ul,.rt-box ol{margin:4px 0;padding-left:22px}
.rt-box div,.rt-box p{margin:0}
.footer-address{text-align:center;font-size:12.5px;color:var(--sheet-soft);line-height:1.6;margin-top:34px}
.footer-address [contenteditable]{outline:none;border-radius:4px;padding:0 2px;min-height:1.6em}
.footer-address [contenteditable]:hover,.footer-address [contenteditable]:focus{background:#fafbfc}
.footer-address [contenteditable]:empty{min-height:0}

.ref-title{text-align:center;font-size:22px;font-weight:700;letter-spacing:1px;margin:6px 0 30px}
.ref-grid{width:88%;margin:0 auto;display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
.ref-cell{aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;padding:8%;overflow:hidden}
.ref-cell.filled{border:1px solid #d8dadf;background:#fff}
.ref-cell img{max-width:100%;max-height:100%;object-fit:contain;display:block}

/* kayıt panelleri */
.records-grid{max-width:860px;margin:0 auto 18px;display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media (max-width:700px){.records-grid{grid-template-columns:1fr}.sheet{padding:28px 18px;min-height:0;overflow-x:auto}}
.record-panel{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:14px 16px}
.record-panel h3{font-size:14px;margin:0 0 10px;color:var(--muted);font-weight:600}
.record-panel input[type=search]{width:100%;font:14px var(--body);padding:8px 10px;border:1px solid var(--line);border-radius:9px;background:var(--bg);color:var(--ink);margin-bottom:10px}
.record-list{max-height:190px;overflow-y:auto;display:flex;flex-direction:column;gap:6px}
.record-item{border:1px solid var(--line);border-radius:9px;padding:7px 10px;cursor:pointer;font-size:14px;overflow-wrap:anywhere}
.record-item:hover{border-color:var(--accent)}
.record-item.selected{border-color:var(--accent);background:var(--accent-soft)}
.record-empty{color:var(--muted);font-size:13px;padding:14px 0;text-align:center}
.record-actions{display:flex;gap:8px;margin-top:10px}
.record-actions button{flex:1;padding:8px;font-size:14px}

/* ayarlar */
.lede{color:var(--muted);max-width:760px;margin:0 0 18px}
.setform{display:grid;grid-template-columns:1fr 1fr;gap:18px 28px;max-width:960px}
@media (max-width:760px){.setform{grid-template-columns:1fr}}
.setcol{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:20px}
.setcol h2{font-size:17px;margin:4px 0 12px}
.setcol h2:not(:first-child){margin-top:22px}
.field small{color:var(--muted);font-weight:400}
.imgbox{border:1px dashed var(--line);border-radius:12px;background:var(--drop);display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:14px;margin:0 0 10px;overflow:hidden}
.imgbox.logo{height:100px}
.refset-head{display:flex;justify-content:space-between;font-size:14px;margin:0 0 8px}.refset-head span{color:var(--muted)}
.refset{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin:0 0 10px}
.refslot{position:relative;aspect-ratio:1/1;border:1px dashed var(--line);border-radius:8px;background:var(--drop);display:flex;align-items:center;justify-content:center;padding:6px;cursor:pointer;color:var(--muted);font-size:20px;user-select:none}
.refslot:hover{border-color:var(--accent);color:var(--accent)}
.refslot.filled{border-style:solid;background:#fff;cursor:grab}
.refslot.over{border-color:var(--accent);background:var(--accent-soft);outline:2px solid var(--accent)}
.refslot img{max-width:100%;max-height:100%;object-fit:contain;pointer-events:none}
.refslot button{position:absolute;top:-6px;right:-6px;width:20px;height:20px;padding:0;border-radius:50%;font-size:11px;line-height:1;background:#fff;color:var(--err);border-color:rgba(201,52,52,.45)}
.hidefile{display:none}
.refset-empty{grid-column:1/-1;color:var(--muted);font-size:14px;padding:14px;border:1px dashed var(--line);border-radius:10px;text-align:center}
.imgbox img{max-width:100%;max-height:100%;object-fit:contain}
.filebtn{position:relative;cursor:pointer}
.filebtn input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}
.check{display:flex;align-items:center;gap:8px;font-size:15px;margin:0 0 12px}
.setfoot{grid-column:1/-1;display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.setfoot .err{color:var(--err);font-size:14px;order:2}
.setfoot .err.ok{color:var(--pos)}

.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(20px);background:#1c1c1e;color:#fff;padding:10px 18px;border-radius:8px;font-size:14px;box-shadow:0 6px 20px rgba(0,0,0,.25);opacity:0;pointer-events:none;transition:opacity .25s,transform .25s;z-index:999;display:flex;align-items:center;gap:8px}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast .toast-dot{width:7px;height:7px;border-radius:50%;background:#4ade80;flex-shrink:0}

.hrow-act{display:flex;gap:8px;justify-content:flex-end}
.hrow-act button{padding:6px 12px;font-size:13.5px}

/* ---------- Yazdırma: yalnızca teklif sayfaları ---------- */
@media print{
  @page{margin:0;size:A4}
  html,body{background:#fff!important;margin:0;padding:0}
  .top,.subebar,.licbar,.expiry,.tabs,.qbar,.page-tabs,.records-grid,.sitefoot,#t-hist,#t-set,.toast,#v-loading,#v-login,#v-blocked{display:none!important}
  main#v-app{max-width:none;padding:0;margin:0}
  .sheet,.sheet.hidden-screen{display:flex!important;box-shadow:none;border:0;border-radius:0;max-width:none;width:210mm;height:297mm;min-height:0;margin:0;padding:16mm 16mm 12mm;box-sizing:border-box;page-break-after:always;page-break-inside:avoid;overflow:hidden}
  #page2{page-break-after:auto}
  .sheet.no-print{display:none!important}
  table.quote-table{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  table.quote-table thead th,.summary-block .srow.total{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  input.cell-name{display:none}
  .cell-name-print{display:block;font-size:13.5px;white-space:normal;word-break:break-word;line-height:1.35}
  input.num-input{border:0;background:transparent;padding:0}
  select.cell-currency{appearance:none;-webkit-appearance:none;border:0;background:transparent;pointer-events:none}
  td.actions-col,th.actions-col,col.actions-col{display:none}
  .recipient [contenteditable],.footer-address [contenteditable],.intro-text{background:transparent!important;border-color:transparent!important}
  .recipient [contenteditable]:empty::before{content:""}
  .rt-bar{display:none}
  .rt-box{border:0;padding:0;overflow:hidden;border-radius:0}
  .rt-box:empty::before{content:""}
  .date-wrap input[type=date]{border-color:transparent;background:transparent}
  .ref-grid{width:160mm;gap:2mm}
}
