/* ==========================================================================
   Zip perde: ayarlar, odeme secenekleri, teklif penceresi, hesap dokumu,
   uretim formu. Sinif oneki: zs- (ayarlar), po- (odeme), zp- (pencere),
   zd- (dokum), zu- (uretim).
   ========================================================================== */

/* ---------- Ortak alanlar ---------- */
.zs { display: flex; flex-direction: column; gap: 12px; }
.zs-form { display: flex; flex-direction: column; gap: 12px; }

.zs input[type="text"],
.zs select,
.zs textarea,
.zp-form input[type="text"],
.zp-form select {
    box-sizing: border-box;
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 13.5px;
}
.zs textarea { height: auto; padding: 8px 10px; resize: vertical; }
.zs input:focus, .zs select:focus, .zs textarea:focus,
.zp-form input:focus, .zp-form select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.zs input:disabled { background: var(--surface-2); color: var(--ink-3); }

.zs-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.zs-field > span { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.zs-field > small { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }

.zs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px 16px;
    padding: 4px 16px 16px;
}
.zs-span { grid-column: 1 / -1; }

.zs-hint { font-size: 12px; color: var(--ink-3); }
.zs-actions, .zs-add, .zs-save {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.zs-actions { padding: 0 16px 16px; }
.zs-add { padding: 10px 16px 16px; }
.zs-save { padding: 4px 0 40px; }
.zs .db-btn, .zp .db-btn { width: auto; }

.zs-explain {
    margin: 0 16px 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--surface-2);
    font-size: 12.5px;
    color: var(--ink-2);
    line-height: 1.5;
}
.zs-explain p { margin: 0; }
.zs-explain p + p { margin-top: 4px; }

/* ---------- Tekrarlanan satirlar (recete, secenekler, odeme) ---------- */
.zs-rows { display: flex; flex-direction: column; }
.zs-row {
    display: grid;
    gap: 8px 10px;
    align-items: end;
    padding: 10px 16px;
    border-top: 1px solid var(--divider, var(--line));
}
.zs-rows > .zs-row:first-child { border-top: 0; }
.zs-row.is-off { opacity: .55; }

.zs-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.zs-cell > span { font-size: 11.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.zs-cell > small { font-size: 11px; color: var(--ink-3); }

.zs-check {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    height: 36px;
    cursor: pointer;
}
.zs-check > span { font-size: 12.5px; color: var(--ink-2); }
.zs-check input { width: 16px; height: 16px; accent-color: var(--brand); }

.zs-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 36px;
    border-radius: 8px;
    color: var(--ink-3);
}
.zs-remove:hover { background: var(--debt-soft); color: var(--debt); }
.zs-remove .icon { font-size: 17px; }

.zs-radio { position: relative; display: inline-flex; width: 20px; height: 36px; align-items: center; cursor: pointer; }
.zs-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.zs-radio span {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--ink-3);
    border-radius: 50%;
    box-sizing: border-box;
}
.zs-radio input:checked + span { border: 5px solid var(--brand); }

/* Odeme secenegi satiri; genis ekranda etiketler yalnizca ilk satirda */
@media (min-width: 1200px) {
    .zs-rows > .po-row:not(:first-child) .zs-cell:not(.zs-check) > span { display: none; }
}
.po-row { grid-template-columns: 20px minmax(180px, 1.4fr) 140px minmax(180px, 2fr) 70px 34px; }
.po-rate small { min-height: 14px; }
.po-rate small.is-discount { color: var(--credit-ink, var(--brand)); }
@media (max-width: 899px) {
    .po-row { grid-template-columns: 20px minmax(0, 1fr) 110px 34px; }
    .po-row .po-note { grid-column: 2 / 4; }
    .po-row .zs-check { grid-column: 2; }
}

/* ==========================================================================
   Teklif formu: zip satiri ve pencere
   ========================================================================== */
.line-row.is-zip { border-color: var(--brand-line); }
.line-zip-bar {
    display: none;
    align-items: center;
    gap: 8px;
    margin: -2px 0 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 12.5px;
}
.line-row.is-zip .line-zip-bar { display: flex; }
.line-zip-bar .icon { font-size: 16px; }
.line-zip-bar b { font-weight: 600; }
.line-zip-bar a { margin-left: auto; color: var(--brand); font-weight: 600; white-space: nowrap; }
.line-zip-bar .line-zip-usd { color: var(--ink-2); }
.dark .line-zip-bar { color: var(--brand); }

.line-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.line-actions .button { width: auto; }

/* Pencere (popup) */
.zp .page-content { background: var(--bg); }
.zp-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    max-width: 1180px;
    margin: 0 auto;
}
@media (min-width: 1000px) {
    .zp-body { grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); align-items: start; }
    .zp-side { position: sticky; top: 12px; }
}
.zp-body .db-card { margin: 0; }
.zp-form { display: flex; flex-direction: column; }
.zp-group { padding: 4px 16px 14px; }
.zp-group + .zp-group { border-top: 1px solid var(--line); padding-top: 14px; }
.zp-group-title { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.zp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.zp-grid .zp-wide { grid-column: 1 / -1; }
@media (min-width: 700px) { .zp-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.zp-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.zp-field > span { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.zp-field > small { font-size: 11.5px; color: var(--ink-3); }
.zp-field input.is-big { height: 44px; font-size: 18px; font-family: var(--font-display); font-weight: 600; }

.zp-seg {
    display: inline-flex;
    padding: 3px;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    gap: 2px;
}
.zp-seg label { position: relative; cursor: pointer; }
.zp-seg input { position: absolute; opacity: 0; pointer-events: none; }
.zp-seg span {
    display: block;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 13px;
    color: var(--ink-2);
    white-space: nowrap;
}
.zp-seg input:checked + span { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.zp-switch { display: flex; align-items: center; gap: 8px; height: 36px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.zp-switch input { width: 16px; height: 16px; accent-color: var(--brand); }

/* Sonuc karti */
.zp-result .db-card-head { align-items: baseline; }
.zp-price { padding: 4px 16px 14px; }
.zp-price-label { font-size: 12.5px; color: var(--ink-2); }
.zp-price-main { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.zp-price-sub { font-size: 12.5px; color: var(--ink-3); }
.zp-price-sub b { color: var(--ink-2); font-weight: 600; }
.zp-break { border-top: 1px solid var(--line); padding: 8px 16px 12px; }
.zp-break-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; }
.zp-break-row > span { color: var(--ink-2); }
.zp-break-row small { color: var(--ink-3); font-size: 11.5px; }
.zp-break-row.is-total { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 9px; font-weight: 600; }
.zp-break-row.is-total > span { color: var(--ink); }
.zp-warn { margin: 0 16px 12px; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn-ink); font-size: 12.5px; }
.zp-error { margin: 0 16px 12px; padding: 8px 10px; border-radius: 8px; background: var(--debt-soft); color: var(--debt); font-size: 12.5px; }
.zp-empty { padding: 26px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }
.zp-foot {
    display: flex;
    gap: 8px;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--line);
}
.zp-foot .db-btn { flex: 1; justify-content: center; }
.zp-foot .db-btn[disabled] { opacity: .5; pointer-events: none; }
.zp-margin-row { display: flex; align-items: center; gap: 8px; }
.zp-margin-row input { max-width: 90px; }

/* ==========================================================================
   Hesap dokumu ve uretim formu
   ========================================================================== */
.zd-table td.is-num, .zd-table th.is-num { text-align: right; white-space: nowrap; }
.zd-table tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.zd-muted { color: var(--ink-3); }
.zd-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 14px; }

.zu-table { min-width: 980px; }
.zu-table th { font-size: 11.5px; }
.zu-table td, .zu-table th { padding: 8px 8px; }
.zu-poz { font-family: var(--font-display); font-weight: 600; }
.zu-cell-main { display: block; font-weight: 600; }
.zu-cell-sub { display: block; font-size: 11.5px; color: var(--ink-3); }
.zu-note { margin: 0 16px 16px; padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn-ink); font-size: 12.5px; line-height: 1.5; }

/* Kart basligi: aciklama dar kartta alta insin */
.zs .db-card-head, .zp .db-card-head, .zd .db-card-head { flex-wrap: wrap; gap: 2px 12px; }
.zs .db-card-head h2, .zp .db-card-head h2, .zd .db-card-head h2 { white-space: nowrap; }

/* "%5 indirim" etiketi satir hizasini bozmasin */
.po-row { padding-bottom: 22px; }
.po-rate { position: relative; }
.po-rate small { position: absolute; left: 2px; top: calc(100% + 3px); white-space: nowrap; }

/* Teklif formu: odeme secenekleri secimi */
.pay-pick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
    margin: 8px 16px 0;
}
.pay-pick-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
}
.pay-pick-item:has(input:checked) { border-color: var(--brand-line); background: var(--brand-soft); }
.pay-pick-item input { width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.pay-pick-main { display: flex; flex-direction: column; min-width: 0; }
.pay-pick-main b { font-size: 13.5px; font-weight: 600; }
.pay-pick-main small { font-size: 12px; color: var(--ink-3); }
.pay-pick-tools { grid-column: 1 / -1; display: flex; gap: 14px; font-size: 12.5px; }
.pay-pick-tools a { color: var(--brand); }

/* Pencere masaustunde genis acilsin (F7 varsayilani 630x630) */
.popup.zip-popup {
    --f7-popup-tablet-width: min(1180px, 94vw);
    --f7-popup-tablet-height: min(860px, 92vh);
    --f7-popup-tablet-border-radius: 14px;
}
.zip-popup .navbar .nav-btn { width: auto; }

/* Siparis detayi */
.od-zip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
}
.od-zip .icon { font-size: 14px; }
.od-pay-rate { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.zu-poz { white-space: nowrap; }
.zu-table .zu-cell-main { white-space: nowrap; }
.zu-table td:nth-child(3) .zu-cell-main, .zu-table td:nth-child(4) .zu-cell-main { white-space: normal; }

/* Telefonda pencere: tek sutun, secimler tam genislik */
@media (max-width: 599px) {
    .zp-body { padding: 8px; }
    .zp-grid { grid-template-columns: minmax(0, 1fr); }
    .zp-grid.is-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .zp-seg { display: flex; }
    .zp-seg label { flex: 1; min-width: 0; }
    .zp-seg span { text-align: center; padding: 6px 6px; }
}
.zd-off td { color: var(--ink-3); }
.zd .db-table-wrap { overflow-x: auto; }


/* ==========================================================================
   Zip perde ayarlari (yeni duzen): sekmeler, ornek hesap, recete tablosu,
   secenek kartlari, fiyat ve kur. Onekler: zs- (sayfa), zx- (ornek hesap),
   zr- (recete), zo- (secenekler), zk- (fiyat ve kur).
   ========================================================================== */

.zs2 { display: flex; flex-direction: column; gap: 12px; padding-bottom: 80px; }
.zs2 .db-card { margin: 0; }
.zs2 [hidden] { display: none !important; }
.zs2 button { width: auto; }
.zs2 input[type="text"], .zs2 select, .zs2 textarea {
    box-sizing: border-box;
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
}
.zs2 textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.zs2 input:focus, .zs2 select:focus, .zs2 textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.navbar button.nav-btn { width: auto; border: 0; font: inherit; cursor: pointer; }

/* ---------- Sekmeler ---------- */
.zs-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    align-self: flex-start;
    max-width: 100%;
    overflow-x: auto;
}
.zs-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink-2);
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}
.zs-tab .icon { font-size: 17px; }
.zs-tab span {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--ink-3);
    font-size: 11.5px;
    font-weight: 600;
}
.zs-tab:hover { color: var(--ink); background: var(--surface-2); }
.zs-tab.is-active { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.zs-tab.is-active span { background: var(--surface); color: var(--brand-strong); }
.dark .zs-tab.is-active, .dark .zs-tab.is-active span { color: var(--brand); }

/* ---------- Ornek hesap ---------- */
.zx { padding: 0; overflow: hidden; }
.zx-inputs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}
.zx-title { font-family: var(--font-display); font-weight: 600; font-size: 14px; margin-right: 4px; }
.zx-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.zx-field span { font-weight: 600; color: var(--ink-3); }
.zx-field em { font-style: normal; color: var(--ink-3); font-size: 12px; }
.zs2 .zx-field input { width: 76px; height: 30px; font-family: var(--font-display); font-weight: 600; }
.zx-seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.zx-seg label { position: relative; cursor: pointer; }
.zx-seg input { position: absolute; opacity: 0; pointer-events: none; }
.zx-seg span { display: block; padding: 4px 10px; border-radius: 6px; font-size: 12.5px; color: var(--ink-2); }
.zx-seg input:checked + span { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.dark .zx-seg input:checked + span { color: var(--brand); }
.zx-note { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.zx-note.is-error { color: var(--debt); }
.zx-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.zx-kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-left: 1px solid var(--line); min-width: 0; }
.zx-kpi:first-child { border-left: 0; }
.zx-kpi span { font-size: 12px; color: var(--ink-2); }
.zx-kpi b { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.zx-kpi small { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zx-kpi.is-total { background: var(--surface-2); }
.zx-kpi.is-sale b { color: var(--brand); }
.zx.is-loading .zx-kpi b { opacity: .45; }
@media (max-width: 899px) {
    .zx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .zx-kpi { border-left: 0; border-top: 1px solid var(--line); }
    .zx-kpi.is-sale { grid-column: 1 / -1; }
    .zx-note { margin-left: 0; width: 100%; }
}

/* ---------- Recete tablosu ---------- */
.zr-card { overflow: visible; }
.zr-head, .zr-row {
    display: grid;
    grid-template-columns: 26px minmax(110px, .8fr) 58px minmax(120px, .9fr) minmax(250px, 2.6fr) minmax(56px, .45fr) minmax(150px, 1.15fr) 108px 30px;
    gap: 8px;
    align-items: center;
    padding: 0 12px 0 8px;
}
.zr-head {
    position: sticky;
    top: 0;
    z-index: 2;
    height: 38px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    border-radius: 12px 12px 0 0;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.zr-h-views { display: flex; justify-content: space-around; }
.zr-h-views .icon { font-size: 15px; }

.zr-row { min-height: 54px; padding-top: 7px; padding-bottom: 7px; border-bottom: 1px solid var(--line); background: var(--surface); }
.zr-row:hover { background: var(--surface-2); }
.zr-row.is-off { background: var(--surface-2); }
.zr-row.is-off .zr-cell:not(.zr-views) { opacity: .5; }
.zr-row.is-dragging { opacity: .4; }
.zr-row.drop-before { box-shadow: inset 0 2px 0 var(--brand); }
.zr-row.drop-after { box-shadow: inset 0 -2px 0 var(--brand); }

.zr-handle { display: flex; align-items: center; justify-content: center; height: 34px; color: var(--ink-3); cursor: grab; }
.zr-handle .icon { font-size: 16px; }
.zr-handle:active { cursor: grabbing; }
.zr-cell { min-width: 0; }
.zr-code { display: flex; flex-direction: column; gap: 2px; }
.zr-name { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 2px; }
.zr-name:empty { display: none; }
.zs2 .zr-code input, .zs2 .zr-formula input, .zs2 .zr-qty input {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12.5px;
}
.zs2 .zr-row input.is-invalid { border-color: var(--debt); background: var(--debt-soft); }
.zr-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 24px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 600;
}
.zr-pill.is-profile { background: var(--warn-soft); color: var(--warn-ink); }
.zr-pill.is-empty { color: var(--ink-3); }

.zr-result { display: flex; flex-direction: column; gap: 1px; font-size: 12px; line-height: 1.3; }
.zr-result-main { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zr-result-sub { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zr-result-sub b { color: var(--ink-2); font-weight: 600; }
.zr-result.is-unused .zr-result-main, .zr-result.is-off .zr-result-main { font-family: inherit; color: var(--ink-3); }
.zr-result.is-error .zr-result-main { font-family: inherit; color: var(--debt); white-space: normal; }
.zr-result .is-nocost { text-decoration: line-through; }

.zr-views { display: flex; gap: 4px; justify-content: space-between; }
.zr-view { position: relative; cursor: pointer; }
.zr-view input { position: absolute; opacity: 0; pointer-events: none; }
.zr-view span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink-3);
    background: var(--surface);
}
.zr-view span .icon { font-size: 16px; }
.zr-view input:checked + span { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand-strong); }
.zr-view input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft); }
.dark .zr-view input:checked + span { color: var(--brand); }

.zr-remove { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 7px; color: var(--ink-3); }
.zr-remove:hover { background: var(--debt-soft); color: var(--debt); }
.zr-remove .icon { font-size: 16px; }

.zr-foot { display: flex; align-items: center; gap: 12px; padding: 10px 12px; flex-wrap: wrap; }
.zr-stat { font-size: 12px; color: var(--ink-3); }

.zr-help { border-top: 1px solid var(--line); padding: 10px 12px 12px; background: var(--surface-2); border-radius: 0 0 12px 12px; }
.zr-vars { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.zr-vars-title { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-right: 4px; }
.zr-var {
    height: 26px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink-2);
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12px;
    cursor: pointer;
}
.zr-var:hover { border-color: var(--brand-line); color: var(--brand); }
.zr-var.is-op { color: var(--brand); }
.zr-howto { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.zr-howto summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.zr-howto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 6px 20px; margin-top: 8px; }
.zr-howto-grid p { margin: 0; line-height: 1.55; }
.zr-howto code, .zr-howto-grid code {
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 11.5px;
}

/* Recete: dar ekranda kart */
@media (max-width: 1099px) {
    .zr-head { display: none; }
    .zr-row {
        grid-template-columns: 26px minmax(0, 1fr) 62px 30px;
        grid-template-areas:
            "handle code  kind   remove"
            ".      label label  label"
            ".      formula formula formula"
            ".      qty   views  views"
            ".      result result result";
        gap: 6px 8px;
        padding: 10px 12px 10px 6px;
    }
    .zr-handle { grid-area: handle; }
    .zr-code { grid-area: code; }
    .zr-kind { grid-area: kind; }
    .zr-remove { grid-area: remove; }
    .zr-label { grid-area: label; }
    .zr-formula { grid-area: formula; }
    .zr-qty { grid-area: qty; }
    .zr-views { grid-area: views; justify-content: flex-end; }
    .zr-result { grid-area: result; }
    .zr-formula::before, .zr-qty::before { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 2px; }
    .zr-formula::before { content: "Ölçü (mm)"; }
    .zr-qty::before { content: "Adet"; }
}

/* ---------- Secenekler ---------- */
.zo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; align-items: start; }
.zo-card .db-card-head { padding-bottom: 8px; }
.zo-star-hint { font-size: 12px; color: #e0a526; vertical-align: -1px; }
.zo-rows { display: flex; flex-direction: column; }
.zo-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto 28px;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 4px 12px 4px 10px;
    border-top: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
}
.zo-row:hover { background: var(--surface-2); }
.zo-none { grid-template-columns: 28px minmax(0, 1fr); cursor: pointer; }
.zo-main { display: flex; flex-direction: column; min-width: 0; }
.zo-main b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zo-main small { font-size: 11.5px; color: var(--ink-3); }
.zo-price { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.zo-star { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; cursor: pointer; }
.zo-star input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.zo-star .icon { font-size: 18px; color: var(--line); transition: color .15s; }
.zo-star:hover .icon { color: #f0c560; }
.zo-star input:checked + .icon { color: #e0a526; }
.zo-remove { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; color: var(--ink-3); }
.zo-remove:hover { background: var(--debt-soft); color: var(--debt); }
.zo-remove .icon { font-size: 15px; }
.zo-swatch { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--violet-soft); color: var(--violet); }
.zo-swatch .icon { font-size: 15px; }
.zo-chevron { font-size: 14px; color: var(--ink-3); }
.zo-add { padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.zo-add .db-btn { width: auto; }

/* ---------- Fiyat ve kur ---------- */
.zk-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 12px; align-items: end; padding: 6px 0 0; }
.zk-rate { display: flex; flex-direction: column; gap: 6px; }
.zk-rate-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.zk-rate-cur { font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.zk-rate-src { font-size: 11.5px; color: var(--ink-3); }
.zk-rate-src.is-late { color: var(--debt); }
.zk-rate-input, .zk-input { position: relative; }
.zs2 .zk-rate-input input { height: 42px; padding-right: 30px; font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.zk-rate-input span, .zk-input em {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-style: normal;
    color: var(--ink-3);
    font-size: 13px;
    pointer-events: none;
}
.zk-actions { display: flex; gap: 8px; }
.zk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.zk-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 6px 0 0; }
.zk-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.zk-field > span { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.zk-field > small { font-size: 11.5px; color: var(--ink-3); min-height: 15px; }
.zs2 .zk-input input { padding-right: 34px; }
.zk-span { grid-column: 1 / -1; }
@media (max-width: 899px) {
    .zk-form { grid-template-columns: minmax(0, 1fr); }
    .zk-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Kaydedilmemis degisiklik cubugu ---------- */
.zs-savebar {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    display: none;
    align-items: center;
    gap: 10px;
    align-self: center;
    padding: 8px 8px 8px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(15, 23, 32, .14);
    font-size: 13px;
}
.zs-savebar.is-visible { display: flex; }
.zs-savebar > span { display: inline-flex; align-items: center; gap: 6px; color: var(--warn-ink); font-weight: 500; margin-right: 6px; }
.zs-savebar > span .icon { font-size: 17px; }
.zs-savebar .db-btn { width: auto; }
.zr-handle { touch-action: none; user-select: none; }
.zr-row.is-dragging { opacity: 1; position: relative; z-index: 3; box-shadow: 0 6px 18px rgba(15, 23, 32, .16); background: var(--surface); }
.navbar button.nav-btn-compact { border: 0; background: none; color: var(--brand); padding: 0; cursor: pointer; width: auto; }

/* Secim kutulari: yazi alanindan ayrilsin diye sagda asagi ok */
.zp-form select,
.zs select,
.zs2 select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7480' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 12px 8px;
    cursor: pointer;
}
.dark .zp-form select,
.dark .zs select,
.dark .zs2 select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239aa3ad' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.zp-form select:hover, .zs select:hover, .zs2 select:hover { border-color: var(--brand-line); }

/* ==========================================================================
   Zip perde hesap dokumu (yeni duzen) ve teknik cizim. Onek: zd-, zw-
   ========================================================================== */
.zd2 .db-card-head { flex-wrap: wrap; gap: 2px 12px; }
.zd2 .db-card-head h2 { white-space: nowrap; }

.zd-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 28px;
    padding: 20px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.zd-hero-main { display: flex; gap: 16px; min-width: 0; flex: 1 1 420px; }
.zd-hero-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
}
.zd-hero-icon .icon { font-size: 26px; }
.zd-hero-text { min-width: 0; }
.zd-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12.5px; color: var(--ink-3); }
.zd-eyebrow a { color: var(--brand); text-decoration: none; font-weight: 600; }
.zd-title { margin: 8px 0 0; font-family: var(--font-display); font-size: 25px; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
.zd-title small { font-size: 15px; color: var(--ink-3); font-weight: 500; }
.zd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.zd-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--ink-2);
}
.zd-tag .icon { font-size: 14px; color: var(--ink-3); }
.zd-hero-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.zd-hero-price > span { font-size: 12.5px; color: var(--ink-2); }
.zd-hero-price > span small { color: var(--ink-3); }
.zd-hero-price b { font-family: var(--font-display); font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.zd-hero-price small { font-size: 12px; color: var(--ink-3); }
.zd-hero-price em {
    margin-top: 6px;
    padding: 3px 9px;
    border-radius: 7px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-style: normal;
    font-size: 12.5px;
    font-weight: 600;
}
.dark .zd-hero-price em { color: var(--brand); }
.zd2 .zd-good { color: var(--credit); }
@media (max-width: 699px) {
    .zd-hero { padding: 16px; }
    .zd-hero-price { align-items: flex-start; text-align: left; }
    .zd-hero-price b { font-size: 26px; }
    .zd-title { font-size: 20px; }
}

/* Cizim */
.zd-draw-card .db-card-head { padding-bottom: 10px; }
.zw { padding: 4px 12px 0; }
.zw-canvas { width: 100%; min-height: 120px; }
.zw-canvas canvas { display: block; }
.zw-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    border: 1px dashed var(--line);
    border-radius: 10px;
    color: var(--ink-3);
    font-size: 13px;
}
.zd-legend {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px 16px;
    margin: 0;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--line);
    list-style: none;
}
.zd-legend li { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 8px; align-items: center; }
.zd-legend b { font-size: 13px; font-weight: 600; }
.zd-legend small { grid-column: 2; font-size: 12px; color: var(--ink-3); }
.zd-no {
    grid-row: span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
}
.zd-no.is-sm { width: 18px; height: 18px; font-size: 10.5px; flex: none; }

/* Malzeme grubu */
.zd-group + .zd-group { border-top: 1px solid var(--line); }
.zd-group-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px 6px; }
.zd-group-head b { font-size: 14px; font-weight: 600; }
.zd-group-head small { font-size: 12px; color: var(--ink-3); }
.zd-group-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--ink-2);
}
.zd-group-icon .icon { font-size: 16px; }
.zd-group-total { margin-left: auto; font-family: var(--font-display); font-size: 16px; font-weight: 600; white-space: nowrap; }
.zd-group-total em {
    margin-left: 8px;
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-family: var(--font-sans);
    font-size: 11.5px;
    font-style: normal;
    font-weight: 600;
}
.zd-item { display: flex; align-items: center; gap: 8px; }
.zd-item > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.zd-item small { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.zd-fabric { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; padding: 8px 20px 18px; }
.zd-fabric > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); }
.zd-fabric span { font-size: 12px; color: var(--ink-3); }
.zd-fabric b { font-family: var(--font-display); font-size: 16px; font-weight: 600; }

/* Fiyat olusumu */
.zd-stack { display: flex; height: 10px; margin-top: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.zd-stack span { display: block; height: 100%; }
.zd-stack .is-profile, .zd-dot.is-profile { background: var(--brand); }
.zd-stack .is-consumable, .zd-dot.is-consumable { background: var(--warn); }
.zd-stack .is-fabric, .zd-dot.is-fabric { background: var(--violet); }
.zd-steps { display: flex; flex-direction: column; margin-top: 10px; }
.zd-step { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; font-size: 13px; }
.zd-step > span { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); min-width: 0; }
.zd-step > span small { color: var(--ink-3); font-size: 11.5px; }
.zd-step b { font-weight: 600; white-space: nowrap; }
.zd-step.is-op > span { color: var(--ink-3); font-size: 12.5px; padding-left: 14px; }
.zd-step.is-sum { border-top: 1px dashed var(--line); margin-top: 2px; padding-top: 9px; }
.zd-step.is-sum > span { color: var(--ink); font-weight: 600; }
.zd-dot { width: 8px; height: 8px; border-radius: 2px; }
.zd-final {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
}
.zd-final span { font-size: 13px; font-weight: 600; }
.zd-final b { font-family: var(--font-display); font-size: 21px; font-weight: 600; }

/* Secimler */
.zd-choices { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.zd-choice { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.zd-choice + .zd-choice { border-top: 1px solid var(--line); }
.zd-choice > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.zd-choice small { font-size: 11.5px; color: var(--ink-3); }
.zd-choice b { font-size: 13.5px; font-weight: 600; }
.zd-choice-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--ink-2);
}
.zd-choice-icon .icon { font-size: 16px; }
.zd-swatch {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: inset 0 0 0 3px var(--surface);
}
.zd-title-sep { color: var(--ink-3); font-weight: 400; }
.zp-draw { padding: 0 12px 6px; border-bottom: 1px solid var(--line); }
.zp-draw .zw-empty { min-height: 110px; border: 0; }
.zd-table .zd-item .zd-no { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }

/* Uretim formu: poz cizimleri */
.zu-draws { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); gap: 12px; }
.zu-draw { margin: 0; }
.zu-draw-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px 4px; }
.zu-draw-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.zu-draw-head b { font-size: 14px; font-weight: 600; }
.zu-draw-head small { font-size: 12px; color: var(--ink-3); }
.zu-draw-head .zd-no { width: 30px; height: 30px; font-size: 11px; grid-row: auto; }
.zu-draw-qty { padding: 3px 9px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-strong); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.dark .zu-draw-qty { color: var(--brand); }
.zu-draw .zw { padding-bottom: 10px; }

/* Odeme secenegi: belge dillerindeki ad ve aciklama */
.po-tr {
    grid-column: 2 / -2;
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(180px, 2fr);
    gap: 8px 10px;
    margin-top: 2px;
}
.zs-rows > .po-row .po-tr .zs-cell > span { display: inline; }
@media (max-width: 899px) {
    .po-tr { grid-column: 2 / -1; grid-template-columns: minmax(0, 1fr); }
}
