/* ==========================================================================
   Siparis detayi (yeni duzen). Onek: ov-
   Ozet karti + asama cizgisi, ozet seridi, kart gorunumlu kalemler,
   odeme secenegi kutulari, kar cubugu.
   ========================================================================== */

/* ---------- Ozet karti ---------- */
.ov-hero {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 22px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.ov-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 28px;
}
.ov-hero-main { min-width: 0; flex: 1 1 380px; }
.ov-eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    font-size: 12.5px;
    color: var(--ink-3);
}
.ov-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 0;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -.015em;
    line-height: 1.2;
}
.ov-title a { min-width: 0; overflow-wrap: anywhere; }
.ov-avatar {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
}
.dark .ov-avatar { color: var(--brand); }
.ov-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 10px;
    padding-left: 54px;
    font-size: 13px;
    color: var(--ink-2);
}
.ov-contact > * { display: inline-flex; align-items: center; gap: 5px; color: inherit; text-decoration: none; }
.ov-contact a:hover { color: var(--brand); }
.ov-contact .icon { font-size: 14px; color: var(--ink-3); }

.ov-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.ov-amount span { font-size: 12.5px; color: var(--ink-2); }
.ov-amount b { font-family: var(--font-display); font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.ov-amount small { font-size: 12px; color: var(--ink-3); }

/* ---------- Asama cizgisi ---------- */
.ov-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: none;
}
.ov-step { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; padding-right: 10px; }
/* Asamalar arasi cizgi: noktanin sagindan bir sonraki noktaya */
.ov-step::after {
    content: "";
    position: absolute;
    left: 34px;
    right: 0;
    top: 15px;
    height: 2px;
    background: var(--line);
    z-index: 0;
}
.ov-step:last-child::after { display: none; }
.ov-step.is-done::after { background: var(--brand); }
.ov-step-dot {
    position: relative;
    z-index: 1;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--line);
    background: var(--surface);
    color: var(--ink-3);
}
.ov-step-dot .icon { font-size: 15px; }
.ov-step-text {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-right: 8px;
    background: var(--surface);
}
.ov-step-text b { font-size: 13px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.ov-step-text small { font-size: 11.5px; color: var(--ink-3); min-height: 14px; }
.ov-step.is-done .ov-step-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.ov-step.is-done .ov-step-text b { color: var(--ink); }
.ov-step.is-current .ov-step-dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.ov-step.is-current .ov-step-text b { color: var(--brand); }
.dark .ov-step.is-done .ov-step-dot { color: #0f1418; }

.ov-cancelled {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--debt-soft);
    color: var(--debt);
    font-size: 13px;
}
.ov-cancelled .icon { font-size: 20px; }

.ov-actions { padding-top: 14px; }

/* ---------- Ozet seridi ---------- */
.ov-summary .ov-good { color: var(--credit); }
.ov-summary small.is-late { color: var(--debt); }

/* ---------- Kalemler ---------- */
.ov-lines .db-card-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ov-line {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas:
        "icon main total"
        "icon main price";
    grid-template-rows: auto 1fr;
    gap: 2px 18px;
    align-items: start;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
}
.ov-line:hover { background: var(--surface-2); }
.ov-line-icon {
    grid-area: icon;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--ink-2);
}
.ov-line-icon .icon { font-size: 19px; }
.ov-line.is-zip .ov-line-icon { background: var(--brand-soft); color: var(--brand); }
.ov-line-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.ov-line-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.ov-line-title b { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.ov-line-title small { font-size: 11.5px; color: var(--ink-3); }
.ov-line-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 600;
    transform: translateY(-1px);
}
.ov-line-note { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.ov-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ov-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    font-size: 12px;
    color: var(--ink-2);
    white-space: nowrap;
}
.ov-chip .icon { font-size: 13px; color: var(--ink-3); }
.ov-line-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.ov-line-links:empty { display: none; }
.ov-line-links .od-zip { margin-right: 0; }

.ov-line-price, .ov-line-total { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.ov-line-total { grid-area: total; }
.ov-line-price { grid-area: price; }
.ov-line-price span { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.ov-line-price span b { color: var(--ink); font-weight: 600; }
.ov-line-price small, .ov-line-total small { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.ov-line-total b { font-family: var(--font-display); font-size: 17px; font-weight: 600; white-space: nowrap; }

.ov-totals { display: flex; justify-content: flex-end; padding: 6px 0 10px; }
.ov-totals .od-totals { margin: 6px 20px 4px auto; border-top: 0; }

@media (max-width: 899px) {
    .ov-hero { padding: 16px; }
    .ov-amount { align-items: flex-start; text-align: left; }
    .ov-amount b { font-size: 26px; }
    .ov-contact { padding-left: 0; }
    .ov-title { font-size: 20px; }
    .ov-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .ov-step { flex-direction: column; align-items: flex-start; gap: 6px; }
    .ov-step::after { left: 34px; top: 15px; }
    .ov-step-text b { font-size: 11.5px; white-space: normal; }
    .ov-step-text small { display: none; }

    .ov-line {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        grid-template-areas:
            "icon main  main"
            ".    price total";
        padding: 12px 14px;
    }
    .ov-line-icon { grid-area: icon; width: 36px; height: 36px; }
    .ov-line-main { grid-area: main; }
    .ov-line-price { grid-area: price; align-items: flex-start; text-align: left; }
    .ov-line-total { grid-area: total; }
    .ov-totals .od-totals { margin-right: 14px; }
}

/* ---------- Odeme secenekleri ---------- */
.ov-pay {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    margin-top: 6px;
}
.ov-pay-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 14px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}
.ov-pay-item.is-default { border-color: var(--brand-line); background: var(--brand-soft); }
.ov-pay-item.is-default::after {
    content: "Teklif fiyatı";
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
}
.ov-pay-name { font-size: 13px; font-weight: 600; line-height: 1.35; padding-right: 70px; }
.ov-pay-item:not(.is-default) .ov-pay-name { padding-right: 0; }
.ov-pay-rate {
    align-self: flex-start;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 600;
}
.ov-pay-rate.is-discount { background: var(--credit-soft); color: var(--credit-ink); }
.ov-pay-item b { margin-top: 6px; font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.ov-pay-item small { font-size: 11.5px; color: var(--ink-3); }

/* ---------- Maliyet ve kar ---------- */
.ov-cost-big { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.ov-cost-big b { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -.015em; }
.ov-cost-big b.ov-good { color: var(--credit); }
.ov-cost-big span { font-size: 13px; color: var(--ink-2); }
.ov-cost-bar {
    height: 8px;
    margin-top: 10px;
    border-radius: 6px;
    background: var(--credit-soft);
    overflow: hidden;
}
.ov-cost-bar span { display: block; height: 100%; border-radius: 6px; background: var(--warn); }
.ov-cost-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.ov-cost-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ov-cost-legend i { width: 8px; height: 8px; border-radius: 2px; }
.ov-cost-legend i.is-cost { background: var(--warn); }
.ov-cost-legend i.is-net { background: var(--credit-soft); border: 1px solid var(--credit); }
.ov-cost-legend b { color: var(--ink); font-weight: 600; }
.ov-cost-parts { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 4px; }
.ov-cost-parts small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.ov-actions:not(:has(a, button)) { display: none; }
.ov-step-short { display: none; }
@media (max-width: 599px) {
    .ov-step-long { display: none; }
    .ov-step-short { display: inline; }
    .ov-step { padding-right: 4px; }
    .ov-step-text { padding-right: 0; }
}
.ov .db-card-head { flex-wrap: wrap; gap: 2px 12px; }
.ov .db-card-head h2 { white-space: nowrap; }

/* Satir gorseli: zip cizimi, stok karti gorseli, kutu, bas harfler */
.ov-line-icon { overflow: hidden; }
.ov-line-icon.lt-zip { background: var(--surface-2); border: 1px solid var(--line); }
.ov-line-icon.lt-zip canvas { display: block; }
.ov-line-icon.lt-image { background: var(--surface-2); border: 1px solid var(--line); }
.ov-line-icon.lt-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ov-line-icon.lt-product { background: var(--brand-soft); color: var(--brand); }
.ov-line-icon.lt-text {
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
}
.ov-line { grid-template-columns: 44px minmax(0, 1fr) auto; }
.ov-line-icon { width: 44px; height: 44px; }
@media (max-width: 899px) {
    .ov-line { grid-template-columns: 40px minmax(0, 1fr) auto; }
    .ov-line-icon { width: 40px; height: 40px; }
}

/* ---------- Onay paneli: odeme secenegi secimi ---------- */
.ap-section-label { margin: 16px 16px 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ap-options { display: flex; flex-direction: column; gap: 8px; margin: 0 16px; }
.ap-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
}
.ap-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.ap-option input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.ap-option-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ap-option-name { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.ap-option-rate {
    align-self: flex-start;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 600;
}
.ap-option-rate.is-discount { background: var(--credit-soft); color: var(--credit-ink); }
.ap-option b { flex: none; font-family: var(--font-display); font-size: 16px; font-weight: 600; }

.ov-pay-approved { grid-template-columns: 1fr; }
.ov-pay-item.is-approved { border-color: var(--brand-line); background: var(--brand-soft); }
.ov-pay-item.is-approved::after {
    content: "Onaylandı";
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
}
.ov-pay-item.is-approved .ov-pay-name { padding-right: 80px; }
.ov-pay-item.is-approved s { color: var(--ink-3); }

/* ==========================================================================
   Siparis formu (yeni duzen). Onek: of-
   Numarali bolum kartlari, genis ekranda tablo gorunumlu kalemler,
   altta yapiskan genel toplam + kaydet cubugu.
   ========================================================================== */

.of {
    padding: 18px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---------- Baslik: belge kimligi solda, canli ozet sagda ---------- */
.of-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.of-head-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.of-head-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: var(--brand-soft);
    color: var(--brand-strong);
}
.of-head-icon .icon { font-size: 22px; }
.dark .of-head-icon { color: var(--brand); }

/* Form ust karti: diger kartlardan ayrissin; marka renginde ikon kutusu, hafif renkli zemin */
.of-head {
    background: linear-gradient(120deg, var(--brand-soft) 0%, var(--surface) 55%);
    border-color: var(--brand-line);
}
.of-head .of-head-icon {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 55%, transparent);
}
.dark .of-head .of-head-icon { color: var(--bg); }
.of-head-text { min-width: 0; }
.of-head-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.of-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.015em;
    line-height: 1.2;
    color: var(--ink);
}
.of-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--warn-soft);
    color: var(--warn-ink);
    font-size: 11.5px;
    font-weight: 600;
}
.of-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.of-lead { margin: 4px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
.of-lead .num { color: var(--ink-2); font-weight: 600; }
.of-sep { margin: 0 4px; }

.of-head-facts { display: flex; align-items: stretch; margin: 0; min-width: 0; }
.of-fact {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    padding: 2px 22px;
    border-left: 1px solid var(--divider);
}
.of-fact:first-child { border-left: 0; padding-left: 0; }
.of-fact:last-child { padding-right: 0; }
.of-fact dt { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.of-fact dd {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.of-fact dd.is-empty { color: var(--ink-3); font-weight: 500; }
.of-fact-account dd { max-width: 260px; }
.of-fact-total { text-align: right; }
.of-fact-total dd {
    font-family: var(--font-display);
    font-size: 20px;
    letter-spacing: -.02em;
    line-height: 1.1;
}

@media (max-width: 720px) {
    .of-head { padding: 14px 16px; }
    .of-head-facts {
        width: 100%;
        padding-top: 12px;
        border-top: 1px solid var(--divider);
    }
    .of-fact { flex: 1 1 0; padding: 0 12px; }
    .of-fact-account dd { max-width: none; }
    /* Toplam mobilde alt cubukta zaten gorunur */
    .of-fact-total { display: none; }
}

/* ---------- Bolum karti ---------- */
.of-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px 20px 20px;
    min-width: 0;
}
.of-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}
.of-card-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
}
.of-card-head p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
.of-step {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-top: -1px;
    border-radius: 7px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.dark .of-step { color: var(--brand); }
.of-count { font-weight: 500; color: var(--ink-3); font-size: 13px; }

/* Belge bilgileri: F7 listesi kart icinde cercevesiz, alanlar izgarada */
.page .of .of-list.list.no-hairlines-md { margin: 0; }
.page .of .of-list.list.no-hairlines-md > ul {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.page .of .of-list.list.no-hairlines-md > ul::before,
.page .of .of-list.list.no-hairlines-md > ul::after { display: none; }
.page .of .of-list > ul > li { grid-column: auto; }
.page .of .of-list > ul > li.of-span { grid-column: 1 / -1; }
/* Metin alanlari: kutu genel kuraldaki ::before ile cizilir; kenar boslugu sifirlanir */
.md .page .of .of-list .item-content.item-input { padding-left: 0; margin-left: 0; margin-right: 0; }
.md .page .of .of-list .item-content.item-input::before { left: 0; right: 0; }
.md .page .of .of-list .item-content.item-input > .item-inner { padding-right: 14px; }

/* Cari secici ayni kutu gorunumunde */
.page .of .of-list > ul > li:is(.of-span, .of-pick) > .item-link {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    transition: border-color .15s;
}
.page .of .of-list > ul > li:is(.of-span, .of-pick) > .item-link:hover { border-color: var(--brand-line); }
.page .of .of-list > ul > li:is(.of-span, .of-pick) .item-content { padding-left: 14px; }
.page .of .of-list > ul > li:is(.of-span, .of-pick) .item-inner::after { display: none; }
.page .of .of-list > ul > li[hidden] { display: none; }
.page .of .of-list > ul > li:is(.of-span, .of-pick) .item-title { font-size: 14px; }

/* Secici kutusu metin alaniyla ayni hizada: alan kutusu satirin icinde ustten
   ve alttan 8px bosluklu, 56px yuksekliginde cizilir; secici de oyle olsun */
.page .of .of-list > ul > li:is(.of-span, .of-pick):has(> .item-link) { padding: 8px 0; }
.page .of .of-list > ul > li:is(.of-span, .of-pick) > .item-link {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-height: 56px;
}
.page .of .of-list > ul > li:is(.of-span, .of-pick) > .item-link > .item-content { flex: 1; min-width: 0; }

@media (min-width: 900px) {
    /* Varsayilan dort sutun; az alanli kartta bos sutun kalmasin */
    .page .of .of-list.list.no-hairlines-md > ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .page .of .of-list.list.no-hairlines-md > ul:not(:has(> li:nth-child(4))) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    /* Tam satir alan + 3 alan (fatura: cari + 3): uc sutun */
    .page .of .of-list.list.no-hairlines-md > ul:has(> li.of-span:is(:first-child, :last-child)):not(:has(> li:nth-child(5))) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .page .of .of-list.list.no-hairlines-md > ul:not(:has(> li:nth-child(3))) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* Tam satir alan + 2 alan (adres + ilce/il) */
    .page .of .of-list.list.no-hairlines-md > ul:has(> li.of-span):not(:has(> li:nth-child(4))) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .page .of .of-list.list.no-hairlines-md > ul { grid-template-columns: minmax(0, 1fr); }
}

/* Kart ici yardimcilar (cari, hesap, POS, cek formlari) */
.of-segment { margin: 0 0 12px; }
.of-hint { padding: 0 0 12px !important; }
.page .of .of-list textarea.resizable { min-height: 72px; }

/* Canli hesap ozeti (POS cekimi: brut, komisyon, net) */
.of-calc {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--divider);
}
@media (min-width: 900px) { .of-card .of-calc { max-width: 520px; } }

/* Secilen cari ozeti */
.of-account {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--divider);
}
.of-account[hidden] { display: none; }
.of-account-avatar {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 13.5px;
    font-weight: 700;
}
.dark .of-account-avatar { color: var(--brand); }
.of-account-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.of-account-main b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.of-account-main small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.of-account-facts { display: flex; gap: 22px; flex: none; }
.of-account-facts > span { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.of-account-facts > span[hidden] { display: none; }
.of-account-facts small { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.of-account-facts b { font-size: 14px; font-weight: 600; white-space: nowrap; }
.of-account-facts [data-side="debt"] b { color: var(--debt); }
.of-account-facts [data-side="credit"] b { color: var(--credit); }

@media (max-width: 560px) {
    .of-account { flex-wrap: wrap; }
    .of-account-facts { width: 100%; justify-content: flex-start; padding-left: 50px; }
    .of-account-facts > span { align-items: flex-start; }
}

/* ---------- Kalemler ---------- */
.of-card-lines { container-type: inline-size; }

/* Genel form kurali (kalemler solda, toplam sagda) yerine: kalemler tam
   genislik, altta solda ekleme dugmeleri, sagda toplam ozeti */
.page form.of .line-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 0;
}
.page form.of .line-editor > .line-list,
.page form.of .line-editor > .line-actions { padding: 0; grid-column: 1; }
.page form.of .line-editor > .line-actions { margin: 0 !important; }
.page form.of .line-editor > .card {
    grid-column: 1;
    grid-row: auto;
    position: static;
    margin: 0 !important;
    border: 0;
    border-radius: 10px;
    background: var(--surface-2);
}

.of .line-list { counter-reset: of-line; }
.of .line-row { counter-increment: of-line; margin-bottom: 10px; }
.of .line-row::before {
    content: "Kalem " counter(of-line);
    display: block;
    margin: -2px 0 8px 2px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.of .line-cols { display: none; }

.of .line-actions .button {
    flex: 0 0 auto;
    width: auto;
    height: 36px;
    padding: 0 14px;
    border-style: dashed;
    font-size: 13px;
}

@container (min-width: 600px) {
    .page form.of .line-editor {
        grid-template-columns: minmax(0, 1fr) 320px;
        column-gap: 20px;
    }
    .page form.of .line-editor > .line-cols,
    .page form.of .line-editor > .line-list { grid-column: 1 / -1; }
    .page form.of .line-editor > .line-actions { align-self: start; }
    .page form.of .line-editor > .card { grid-column: 2; }
}

/* Tablo gorunumu: satir kartlari tek satirlik izgaraya acilir */
@container (min-width: 860px) {
    .of .line-cols,
    .of .line-row {
        display: grid;
        grid-template-columns: 26px minmax(0, 1fr) 82px 74px 116px 62px 62px 118px 32px;
        column-gap: 8px;
        align-items: center;
    }
    .of .line-cols {
        padding: 0 0 8px;
        border-bottom: 1px solid var(--line);
        font-size: 10.5px;
        font-weight: 700;
        letter-spacing: .05em;
        text-transform: uppercase;
        color: var(--ink-3);
    }
    .of .line-cols span:nth-child(n+3):nth-child(-n+8) { text-align: right; }
    .of .line-cols span:nth-child(4) { text-align: center; }

    .of .line-list { margin-top: -12px; }
    .of .line-row {
        grid-template-areas:
            "zip  zip  zip zip  zip   zip  zip total rm"
            "no   desc qty unit price disc vat total rm"
            ".    note note note note note note . .";
        row-gap: 6px;
        margin: 0;
        padding: 12px 0;
        border: 0;
        border-bottom: 1px solid var(--divider);
        border-radius: 0;
        background: transparent;
    }
    .of .line-row:not(.is-zip) { grid-template-areas:
            "no   desc qty unit price disc vat total rm"
            ".    note note note note note note . ."; }
    .of .line-row::before {
        content: counter(of-line);
        grid-area: no;
        margin: 0;
        font-size: 12.5px;
        letter-spacing: 0;
        text-align: center;
        font-variant-numeric: tabular-nums;
    }
    .of .line-row.is-zip { border-color: var(--divider); }
    .of .line-row.is-zip .line-zip-bar { grid-area: zip; margin: 0; }

    .of .line-head,
    .of .line-fields { display: contents; }
    .of .line-desc-wrap { grid-area: desc; }
    .of .line-remove { grid-area: rm; }
    .of .line-note { grid-area: note; margin: 0; }
    .of .line-fields > .line-field:nth-child(1) { grid-area: qty; }
    .of .line-fields > .line-field:nth-child(2) { grid-area: unit; }
    .of .line-fields > .line-field:nth-child(3) { grid-area: price; }
    .of .line-fields > .line-field:nth-child(4) { grid-area: disc; }
    .of .line-fields > .line-field:nth-child(5) { grid-area: vat; }
    .of .line-total { grid-area: total; margin: 0; padding: 0; border: 0; justify-content: flex-end; }

    /* Etiketler tablo basligina tasindi; ekran okuyucu icin yerinde kalir */
    .of .line-field > span,
    .of .line-note > span,
    .of .line-total > span:first-child {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .of .line-desc-wrap input,
    .of .line-field input,
    .of .line-field select { height: 36px; font-size: 14px; }
    .of .line-desc-wrap input { font-weight: 600; }
    .of .line-note input {
        height: 30px;
        font-size: 12.5px;
        color: var(--ink-2);
        border-color: transparent;
        background: var(--surface-2);
    }
    .of .line-note input:focus { border-color: var(--brand); background: var(--surface); }
    .of .line-total .num { font-size: 14.5px; }
    .of .line-remove:hover { background: var(--debt-soft); color: var(--debt); }
}

/* ---------- Not + odeme ---------- */
.of-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 1000px) {
    .of-pair:not(.is-single) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
}
.of-textarea {
    display: block;
    width: 100%;
    min-height: 104px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
}
.of-textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.of .pay-pick { padding: 0; margin: 0; }

/* ---------- Sartlar: kart ici bosluklar ---------- */
.of-card-terms .terms-editor > .block { padding: 0; margin: 0 0 12px !important; }
.of-card-terms .terms-list { padding: 0; }
.of-card-terms .terms-empty { margin: 0 0 8px; }
.of-card-terms .terms-tools { padding: 0 0 0 26px; }
.of-card-terms .terms-editor > .form-hint { padding: 12px 0 0; }

/* ---------- Yapiskan alt cubuk ---------- */
.of-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 4px -16px 0;
    padding: 12px 16px calc(12px + var(--f7-safe-area-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 18px rgba(16, 24, 32, .06);
}
@media (min-width: 1024px) {
    .of-bar { margin: 4px 0 16px; border: 1px solid var(--line); border-radius: 12px; bottom: 12px; }
}
.of-bar-total { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.of-bar-total small { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.of-bar-total b {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.15;
    white-space: nowrap;
}
.of-bar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.of-bar-actions .button { width: auto; height: 42px; padding: 0 18px; font-size: 14px; }
.of-btn-ghost { color: var(--ink-2); }
.of-btn-save .icon { font-size: 17px; margin-right: 6px; }

@media (max-width: 480px) {
    .of-btn-ghost { display: none; }
    .of-bar-total b { font-size: 19px; }
    .of-card { padding: 16px 14px 16px; }
    .of-title { font-size: 22px; }
}


/* ==========================================================================
   Urun / hizmet formu (of- duzeni uzerine). Onek: pf-
   Tur kartlari, genis ekranda iki sutun: solda bilgiler ve fiyatlar,
   sagda gorsel, stok ve diger ayarlar.
   ========================================================================== */

.pf .of-step .icon { font-size: 14px; }
.of-status.is-type { background: var(--brand-soft); color: var(--brand-strong); }
.dark .of-status.is-type { color: var(--brand); }

/* Tur kartlari */
.pf-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pf-type {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.pf-type:hover { border-color: var(--brand-line); }
.pf-type.button-active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.pf-type:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pf-type-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--ink-2);
}
.pf-type-icon .icon { font-size: 18px; }
.pf-type.button-active .pf-type-icon { background: var(--brand); color: #fff; }
.pf-type-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-right: 16px; }
.pf-type-text b { font-size: 14px; font-weight: 600; }
.pf-type-text small { font-size: 12px; line-height: 1.4; color: var(--ink-3); }
.pf-type-check {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
    color: var(--brand);
}
.pf-type-check .icon { font-size: 16px; }
.pf-type.button-active .pf-type-check { display: block; }

@media (max-width: 900px) { .pf-types { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) {
    .pf-type { padding: 12px; gap: 10px; }
    .pf-type-text small { display: none; }
}

/* Iki sutun */
.pf-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.pf-main, .pf-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (min-width: 1280px) {
    .pf-split { grid-template-columns: minmax(0, 1fr) 380px; }
    .pf-side { position: sticky; top: 14px; }
}

/* Iki sutunlu alan listeleri (genel kuralin 3/4 sutununu ezer) */
@media (min-width: 521px) {
    .page .of .pf-list-2.of-list.list.no-hairlines-md > ul,
    .page .of .pf-list-2.of-list.list.no-hairlines-md > ul:not(:has(> li:nth-child(5))) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.pf-side .of-list.list.no-hairlines-md > ul:has(> li:only-child) { grid-template-columns: minmax(0, 1fr) !important; }

/* Fiyat tablosu kart icinde kenarsiz */
.pf .unit-table.pr-form-units { margin: 0; }
.pf .profile-summary { margin: 12px 0 0 !important; }
.pf-prices .of-card-head { flex-wrap: wrap; }
.pf-prices .of-card-head > div { flex: 1 1 280px; }
.pf-currency { display: flex; flex-direction: column; gap: 4px; flex: none; }
.pf-currency span { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.pf-currency select {
    height: 36px;
    min-width: 170px;
    padding: 0 30px 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7480' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    -webkit-appearance: none;
    appearance: none;
}
.pf-currency select:focus { outline: none; border-color: var(--brand); }
.pf-foot {
    display: flex;
    gap: 8px;
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink-3);
}
.pf-foot .icon { flex: none; font-size: 15px; margin-top: 1px; }

/* Gorsel */
.pf .pr-image-field { margin: 0; }

/* Acma / kapama satiri */
.pf-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
}
.of-list + .pf-switch { margin: 10px 0 0; }
.pf-switch-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-switch-text b { font-size: 14px; font-weight: 600; }
.pf-switch-text small { font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.pf-switch .toggle { flex: none; }

/* Genel form kurali secicileri tam satira yayar; of- formlarinda izgara karar verir */
.page .of .of-list.list.no-hairlines-md > ul > li.of-pick,
.page .of .of-list.list.no-hairlines-md > ul > li.item-input:not(.of-span) { grid-column: auto; }
.page .of .of-list.list.no-hairlines-md > ul > li.of-span { grid-column: 1 / -1; }

/* Hesap formu: tur kutulari ve taksit tablosu of- duzeninde */
.of .surface-list { margin: 0; }
.of .pf-type { text-decoration: none; }

/* of- kart icindeki aciklamalar: sayfa kenar boslugu olmadan */
.of-card > .form-hint { padding: 10px 2px 0; }

/* Cari formu: tur degisince gizlenen kartlar numarada bosluk birakmasin */
.page[data-name="account-form"] .of { counter-reset: of-step; }
.page[data-name="account-form"] .of > .of-card:not([hidden]) { counter-increment: of-step; }
.page[data-name="account-form"] .of-step { font-size: 0; }
.page[data-name="account-form"] .of-step::before { content: counter(of-step); font-size: 12px; }
