/* ═══════════════════════════════════════════════════════════════════════════
 * Müük + Partneri-ala telefonivaade (13.10.2026) — Stitchi „Nordic Workshop Paper"
 * ekraanid m4 (arved: arvekaardid, olekukiip, detail alt avaneva lehena) ja m10
 * (partnerikaardid). Kest (päis, alumine riba, tabel → kaart) tuleb mobile.css /
 * mobile-shell.js-ist; siin on AINULT #sales ja #partner sektsioonide kujundus.
 *
 * Kõik ≤768 px meedia sees ja skoobitud #sales / #partner-iga → lauaarvuti ei muutu.
 * Klassid m-myyk-* paneb static/js/mobile-myyk.js (ainult telefonis).
 *
 * ⛔ Stitchi KPI-riba (Tasumata / Üle tähtaja / Laekus) EI OLE ehitatud: arvete
 *    nimekirja server neid summasid ei serveeri ja raha kliendis üle ei arvutata.
 * ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* ── Ühised ───────────────────────────────────────────────────────────── */
    #sales, #partner { --m-sage: #7c8a6a; --m-clay: #b0694c; --m-brick: #c0392b; --m-info: #2c6b9c; }

    /* Otsinguväljad said lipu kõrval kokku surutud („Ots", „Otsi nir") → oma rida */
    #sales input[type=search], #sales input[placeholder^="Otsi"], #sales input[placeholder^="otsi"],
    #partner input[type=search], #partner input[placeholder^="Otsi"] {
        flex: 1 1 100% !important; width: 100% !important; min-width: 0 !important; max-width: none !important;
    }
    /* …v.a vormi sees olevad otsingud (typeahead), mis on sildi sees niikuinii täislaiuses */

    /* Pealkirjarida „Saatelehed  [+ Uus saateleht]" — pealkiri serifis */
    #salesDispatch > div:first-child h2, #salesInvoices > div:first-of-type h2, #salesReturns h2,
    #salesPriceLists > div:first-child h2 {
        font-family: var(--font-display, Georgia, serif); font-size: 1.4rem; color: var(--m-pruun);
    }

    /* Olekukiibid (inline-värviga span'id) → pill */
    #invoiceList td[data-label="Staatus"] > span:first-child,
    #quoteList td[data-label="Staatus"] > span:first-child,
    #dispatchList .dispatch-row .badge, #priceListsList .order-card .badge {
        display: inline-block; border-radius: 999px !important; padding: 3px 10px !important;
        font-size: 0.74rem !important; font-weight: 600; letter-spacing: 0.01em; line-height: 1.35;
    }

    /* ── Ülevaade: KPI-plaadid kompaktsemaks (numbrid tulevad serverist), viimased tellimused kaartidena ── */
    #salesDashboard .stats { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px !important; }
    #salesDashboard .stat-card { text-align: left !important; padding: 12px 14px !important; margin: 0 !important; min-width: 0 !important; border-radius: 14px; }
    #salesDashboard .stat-card .number { font-size: 1.45rem !important; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
    #salesDashboard .stat-card .label { font-size: 0.78rem !important; line-height: 1.3; margin-top: 4px; }
    /* 1 Tellimus · 2 Klient · 3 Kuupäev · 4 Tk · 5 Summa · 6 Staatus */
    #salesDashboard table.m-kaardid > tbody > tr {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        grid-template-areas: "nr nr sm" "kl kl kl" "kp tk st"; gap: 4px 10px; align-items: center; padding: 12px 14px;
    }
    #salesDashboard table.m-kaardid > tbody > tr > td { order: 0 !important; font-weight: 400; }
    #salesDashboard table.m-kaardid > tbody > tr > td:nth-child(1) { grid-area: nr; font-weight: 600; }
    #salesDashboard table.m-kaardid > tbody > tr > td:nth-child(2) { grid-area: kl; }
    #salesDashboard table.m-kaardid > tbody > tr > td:nth-child(3) { grid-area: kp; font-size: 0.86rem; }
    #salesDashboard table.m-kaardid > tbody > tr > td:nth-child(4) { grid-area: tk; font-size: 0.86rem; }
    #salesDashboard table.m-kaardid > tbody > tr > td:nth-child(5) { grid-area: sm; justify-self: end; font-weight: 700; color: var(--m-messing); white-space: nowrap !important; font-variant-numeric: tabular-nums; }
    #salesDashboard table.m-kaardid > tbody > tr > td:nth-child(6) { grid-area: st; justify-self: end; }
    #salesDashboard table.m-kaardid > tbody > tr > td:is(:nth-child(1), :nth-child(2), :nth-child(5), :nth-child(6))::before { display: none; }
    #salesDashboard table.m-kaardid > tbody > tr > td:nth-child(6) span { border-radius: 999px !important; padding: 2px 9px !important; }

    /* ── Arved (Stitch m4) ───────────────────────────────────────────────── */
    /* Filtririba: kiibid ühel keritaval real, otsing täislaiuses, kuupäevad kõrvuti */
    #invFilterBar { gap: 8px !important; }
    #invFilterBar > div:first-child {
        flex: 1 1 100%; overflow-x: auto; flex-wrap: nowrap !important; scrollbar-width: none; gap: 6px !important;
    }
    #invFilterBar > div:first-child::-webkit-scrollbar { display: none; }
    #invFilterBar .inv-filter-btn { flex: 0 0 auto; border-radius: 999px !important; min-height: 38px; padding: 0 14px; white-space: nowrap; }
    #invFilterBar .inv-filter-btn.active { background: var(--m-pruun) !important; border-color: var(--m-pruun) !important; color: #fff !important; }
    #invFilterBar > label { flex: 1 1 100%; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--m-hall); }
    #invFilterBar > label input { flex: 1 1 auto; width: auto !important; min-width: 0; }
    #invFilterBar > label:first-of-type { flex-direction: column; align-items: stretch; gap: 2px; }
    #invFilterBar > label:first-of-type input { width: 100% !important; }
    #invFilterCount { flex: 1 1 100%; }

    /* Arvekaart: nr + summa paremal · klient · kuupäevad + olekukiip */
    #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        grid-template-areas:
            "nr nr summa"
            "kl kl kl"
            "kp th st"
            "ko ko em";
        gap: 6px 10px; align-items: center; padding: 14px 16px;
    }
    #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) > td { order: 0 !important; }
    /* kreeditarve „K" nr-i ette (samas lahtris), nr nihkub paremale */
    #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) > td:nth-child(1) { grid-area: nr; justify-self: start; align-self: center; }
    #invoiceList > table.m-kaardid > tbody > tr:has(> td:nth-child(1):not(:empty)) > td:nth-child(2) { padding-left: 28px !important; }
    #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) > td:nth-child(2) { grid-area: nr; font-family: var(--font-display, Georgia, serif); font-size: 1.12rem; }
    #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) > td:nth-child(3) { grid-area: kl; font-size: 0.95rem; color: var(--m-tekst); }
    #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) > td:nth-child(4) { grid-area: kp; }
    #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) > td:nth-child(5) { grid-area: th; }
    #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) > td:nth-child(6) { grid-area: st; justify-self: end; align-self: end; }
    #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) > td:nth-child(7) { grid-area: ko; font-size: 0.8rem; }
    #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) > td:nth-child(8) {
        grid-area: summa; justify-self: end; text-align: right !important; font-size: 1.12rem; font-weight: 700;
        color: var(--m-messing); font-variant-numeric: tabular-nums; white-space: nowrap !important;
    }
    #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) > td:nth-child(9) { grid-area: em; justify-self: end; font-size: 0.78rem; }
    #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) > td:is(:nth-child(1), :nth-child(2), :nth-child(3), :nth-child(6), :nth-child(7), :nth-child(8), :nth-child(9))::before { display: none; }
    #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) > td:nth-child(1):empty { display: none; }
    #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) > td:nth-child(4), #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) > td:nth-child(5) { font-size: 0.86rem; font-variant-numeric: tabular-nums; }
    /* Kommentaari veerus „—" (tühi) ja tühi e-posti märge ei vääri kaardil rida */
    #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) > td.m-myyk-tuhi { display: none; }
    #invoiceList > table.m-kaardid > tbody > tr:not([id^="invoiceDetail-"]) > td:nth-child(2) strong { font-weight: 700; color: var(--m-tekst); }

    /* ── Detail alt avaneva lehena (arve, pakkumine) ──────────────────────
       Rida jääb DOM-is oma kohale (kõik onclick'id ja ümberjoonistused töötavad);
       telefonis kuvatakse avatud detailirida fikseeritud lehena. */
    #invoiceList tr[id^="invoiceDetail-"]:not([style*="none"]),
    #quoteList tr[id^="quoteDetail-"]:not([style*="none"]) {
        display: block !important; position: fixed !important; left: 0; right: 0; bottom: 0; top: auto;
        z-index: 2601; max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain;
        margin: 0 !important; padding: 0 0 calc(16px + env(safe-area-inset-bottom, 0px)) !important;
        background: var(--m-paber2) !important; border: 0 !important; border-radius: 22px 22px 0 0 !important;
        box-shadow: 0 -10px 40px rgba(40,28,20,0.25) !important; animation: mTous .22s cubic-bezier(.2,.8,.2,1);
    }
    #invoiceList tr[id^="invoiceDetail-"] > td, #quoteList tr[id^="quoteDetail-"] > td { display: block; background: transparent !important; }
    #invoiceList tr[id^="invoiceDetail-"] > td::before, #quoteList tr[id^="quoteDetail-"] > td::before { display: none !important; }
    #invoiceList tr[id^="invoiceDetail-"] .card, #quoteList tr[id^="quoteDetail-"] .card {
        margin: 0 12px 12px !important; padding: 14px !important; border-radius: 14px; background: var(--m-kaart);
    }
    #mMyykTaust { position: fixed; inset: 0; z-index: 2600; background: rgba(40,28,20,0.42); animation: mHajub .18s ease; }
    body.m-myyk-leht-lahti { overflow: hidden; }

    .m-myyk-pais {
        position: sticky; top: 0; z-index: 3; background: var(--m-paber2);
        padding: 8px 16px 12px; border-bottom: 1px solid var(--m-joon); margin-bottom: 12px;
    }
    .m-myyk-pais .m-myyk-kaepide { width: 44px; height: 5px; border-radius: 3px; background: var(--m-joon); margin: 0 auto 10px; }
    .m-myyk-pais-rida { display: flex; align-items: center; gap: 10px; }
    .m-myyk-pais-rida .m-myyk-kiip { flex: 0 1 auto; min-width: 0; }
    .m-myyk-pais-rida .m-myyk-sulge {
        margin-left: auto; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 0;
        background: transparent; color: var(--m-pruun); font-size: 1.6rem; line-height: 1; cursor: pointer;
    }
    .m-myyk-pais-rida .m-myyk-sulge:active { background: rgba(92,64,51,0.08); }
    .m-myyk-ylasilt { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--m-hall); margin-top: 8px; }
    .m-myyk-nr-summa { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
    .m-myyk-nr { font-family: var(--font-display, Georgia, serif); font-size: 1.6rem; color: var(--m-tekst); overflow-wrap: anywhere; }
    .m-myyk-summa { font-size: 1.45rem; font-weight: 700; color: var(--m-messing); font-variant-numeric: tabular-nums; white-space: nowrap; }
    .m-myyk-klient { font-size: 0.95rem; color: var(--m-tekst); margin-top: 2px; }
    .m-myyk-kiip > span { display: inline-block; border-radius: 999px !important; padding: 3px 10px !important; font-size: 0.78rem !important; font-weight: 600; }

    /* Tegevusnupud lehes: kaks veergu, puuteala 44 px */
    #invoiceList tr[id^="invoiceDetail-"] .card > div:first-child,
    #quoteList tr[id^="quoteDetail-"] .card > div:first-child > div:last-child {
        display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px !important;
    }
    #invoiceList tr[id^="invoiceDetail-"] .card > div:first-child > *,
    #quoteList tr[id^="quoteDetail-"] .card > div:first-child > div:last-child > * { min-height: 44px; width: 100%; margin: 0 !important; }
    #invoiceList tr[id^="invoiceDetail-"] .card > div:first-child > span { display: flex; align-items: center; justify-content: center; }
    #quoteList tr[id^="quoteDetail-"] .card > div:first-child { flex-direction: column; align-items: stretch !important; }
    #quoteList tr[id^="quoteDetail-"] .card > div:first-child > div:first-child { display: none; } /* nr + olek on lehe päises */

    /* Arve read lehes: toode pealkirjaks, numbrid kolmes veerus */
    #invoiceList tr[id^="invoiceDetail-"] table.m-kaardid tr,
    #quoteList tr[id^="quoteDetail-"] table.m-kaardid tr {
        grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; padding: 10px 12px; margin-bottom: 8px;
        box-shadow: none; background: var(--m-paber2) !important;
    }
    #invoiceList tr[id^="invoiceDetail-"] table.m-kaardid td,
    #quoteList tr[id^="quoteDetail-"] table.m-kaardid td { font-size: 0.85rem; font-variant-numeric: tabular-nums; order: 0; grid-column: auto; font-weight: 400; }
    /* arve: 1 Nr · 2 EAN · 3 Kood · 4 Toode · … · 13 Bruto */
    #invoiceList tr[id^="invoiceDetail-"] table.m-kaardid td:nth-child(1) { display: none; }
    #invoiceList tr[id^="invoiceDetail-"] table.m-kaardid td:nth-child(4) { grid-column: 1 / -1; order: -1; font-weight: 600; font-size: 0.95rem; }
    #invoiceList tr[id^="invoiceDetail-"] table.m-kaardid td:nth-child(4)::before { display: none; }
    #invoiceList tr[id^="invoiceDetail-"] table.m-kaardid td:nth-child(13) { font-weight: 700; }
    /* pakkumine: 1 Nr · 2 Kood · 3 EAN · 4 Toode · 5 Kogus · 6 Hind · 7 All · 8 Summa */
    #quoteList tr[id^="quoteDetail-"] table.m-kaardid td:nth-child(1) { display: none; }
    #quoteList tr[id^="quoteDetail-"] table.m-kaardid td:nth-child(4) { grid-column: 1 / -1; order: -1; font-weight: 600; font-size: 0.95rem; }
    #quoteList tr[id^="quoteDetail-"] table.m-kaardid td:nth-child(4)::before { display: none; }
    #quoteList tr[id^="quoteDetail-"] table.m-kaardid td:nth-child(8) { font-weight: 700; }

    /* ── Pakkumised: sama kaardimuster mis arvetel ───────────────────────── */
    /* 1 Pakkumine · 2 Klient · 3 Kommentaar · 4 Kuupäev · 5 Kehtiv kuni · 6 Staatus · 7 Summa */
    #quoteList > table.m-kaardid > tbody > tr:not([id^="quoteDetail-"]) {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        grid-template-areas: "nr nr summa" "kl kl kl" "kp kk st" "ko ko ko";
        gap: 6px 10px; align-items: center; padding: 14px 16px;
    }
    #quoteList > table.m-kaardid > tbody > tr:not([id^="quoteDetail-"]) > td { order: 0 !important; }
    #quoteList > table.m-kaardid > tbody > tr:not([id^="quoteDetail-"]) > td:nth-child(1) { grid-area: nr; font-family: var(--font-display, Georgia, serif); font-size: 1.12rem; }
    #quoteList > table.m-kaardid > tbody > tr:not([id^="quoteDetail-"]) > td:nth-child(2) { grid-area: kl; }
    #quoteList > table.m-kaardid > tbody > tr:not([id^="quoteDetail-"]) > td:nth-child(3) { grid-area: ko; font-size: 0.8rem; }
    #quoteList > table.m-kaardid > tbody > tr:not([id^="quoteDetail-"]) > td:nth-child(4) { grid-area: kp; font-size: 0.86rem; }
    #quoteList > table.m-kaardid > tbody > tr:not([id^="quoteDetail-"]) > td:nth-child(5) { grid-area: kk; font-size: 0.86rem; }
    #quoteList > table.m-kaardid > tbody > tr:not([id^="quoteDetail-"]) > td:nth-child(6) { grid-area: st; justify-self: end; align-self: end; text-align: right !important; }
    #quoteList > table.m-kaardid > tbody > tr:not([id^="quoteDetail-"]) > td:nth-child(7) {
        grid-area: summa; justify-self: end; font-size: 1.12rem; font-weight: 700; color: var(--m-messing);
        font-variant-numeric: tabular-nums; white-space: nowrap !important;
    }
    #quoteList > table.m-kaardid > tbody > tr:not([id^="quoteDetail-"]) > td:is(:nth-child(1), :nth-child(2), :nth-child(3), :nth-child(6), :nth-child(7))::before { display: none; }
    #quoteList > table.m-kaardid td.m-myyk-tuhi { display: none; }

    /* ── Saatelehed: rida → kaart ────────────────────────────────────────── */
    /* päis: 1 nool · strong nr · .badge olek · tellimus · klient · kuupäev · kogus · tegevused */
    #dispatchList .dispatch-row { border-radius: 14px !important; margin-bottom: 10px !important; box-shadow: 0 1px 2px rgba(60,40,30,0.04); }
    #dispatchList .dispatch-row > div:first-child {
        display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        grid-template-areas: "nr nr st" "kl kl kl" "so kp kg" "ac ac ac";
        gap: 6px 10px !important; align-items: center; padding: 14px 16px !important;
    }
    #dispatchList .dispatch-row > div:first-child > span:first-child { display: none; }
    #dispatchList .dispatch-row > div:first-child > strong { grid-area: nr; min-width: 0 !important; font-size: 1.08rem; }
    #dispatchList .dispatch-row > div:first-child > .badge { grid-area: st; justify-self: end; }
    #dispatchList .dispatch-row > div:first-child > span:nth-last-child(5) { grid-area: so; overflow-wrap: anywhere; }
    #dispatchList .dispatch-row > div:first-child > span:nth-last-child(4) { grid-area: kl; white-space: normal !important; font-size: 0.95rem !important; color: var(--m-tekst); }
    #dispatchList .dispatch-row > div:first-child > span:nth-last-child(3) { grid-area: kp; font-variant-numeric: tabular-nums; }
    #dispatchList .dispatch-row > div:first-child > span:nth-last-child(2) { grid-area: kg; min-width: 0 !important; font-variant-numeric: tabular-nums; }
    #dispatchList .dispatch-row > div:first-child > span:last-child {
        grid-area: ac; display: flex !important; flex-wrap: wrap !important; gap: 8px !important;
        padding-top: 10px; border-top: 1px solid var(--m-joon);
    }
    #dispatchList .dispatch-row > div:first-child > span:last-child .btn { min-height: 44px; flex: 1 1 auto; }
    #dispatchList .dispatch-row > div:first-child > span:last-child .btn-sm[title="Vaata brauseris"] { flex: 0 0 48px; }
    /* avatud detail kaardi sees */
    #dispatchList .dispatch-row > div:nth-child(2) { padding: 12px 14px !important; }
    #dispatchList .dispatch-row > div:nth-child(2) > div:first-child { flex-direction: column; gap: 4px !important; }
    /* saatelehe read: 1 Nr · 2 EAN · 3 Toode · 4 Partii · 5 Parim enne · 6 Kogus */
    #dispatchList .dispatch-row table.m-kaardid tr { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; padding: 10px 12px; box-shadow: none; background: var(--m-paber2) !important; }
    #dispatchList .dispatch-row table.m-kaardid td { order: 0; grid-column: auto; font-weight: 400; font-size: 0.85rem; }
    #dispatchList .dispatch-row table.m-kaardid td:nth-child(1) { display: none; }
    #dispatchList .dispatch-row table.m-kaardid td:nth-child(3) { grid-column: 1 / -1; order: -1; font-weight: 600; font-size: 0.95rem; }
    #dispatchList .dispatch-row table.m-kaardid td:nth-child(3)::before { display: none; }
    /* filtririda */
    #salesDispatch > div:nth-child(2) > label { flex: 1 1 100%; flex-wrap: wrap; }
    #salesDispatch > div:nth-child(2) > label input[type=date] { flex: 1 1 0; min-width: 0; }

    /* ── Tagastused (sama filtririda) ── */
    #salesReturns #returnsSearch { flex-basis: 100% !important; }

    /* ── Hinnakirjad: rida → kaart ──────────────────────────────────────── */
    /* päis: nool · strong nimi · .badge olek · [.badge kampaania] · klient · kehtivus · tooteid · valuuta · tegevused */
    #priceListsList .order-card { border-radius: 14px !important; margin-bottom: 10px !important; }
    #priceListsList .order-card > div:first-child {
        display: grid !important; grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas: "nm nm st" "kl kl kmp" "kv kg vl" "ac ac ac";
        gap: 6px 10px !important; align-items: center; padding: 14px 16px !important;
    }
    #priceListsList .order-card > div:first-child > span:first-child { display: none; }
    #priceListsList .order-card > div:first-child > strong {
        grid-area: nm; min-width: 0 !important; white-space: normal !important; font-family: var(--font-display, Georgia, serif);
        font-size: 1.05rem; line-height: 1.3;
    }
    #priceListsList .order-card > div:first-child > strong + .badge { grid-area: st; justify-self: end; align-self: start; }
    #priceListsList .order-card > div:first-child > .badge + .badge { grid-area: kmp; justify-self: end; }
    #priceListsList .order-card > div:first-child > span:nth-last-child(5) { grid-area: kl; white-space: normal !important; }
    #priceListsList .order-card > div:first-child > span:nth-last-child(4) { grid-area: kv; font-variant-numeric: tabular-nums; }
    #priceListsList .order-card > div:first-child > span:nth-last-child(3) { grid-area: kg; min-width: 0 !important; }
    #priceListsList .order-card > div:first-child > span:nth-last-child(2) { grid-area: vl; }
    #priceListsList .order-card > div:first-child > span:last-child {
        grid-area: ac; display: grid !important; grid-template-columns: 2fr repeat(3, minmax(0, 1fr)); gap: 8px !important;
        padding-top: 10px; border-top: 1px solid var(--m-joon);
    }
    #priceListsList .order-card > div:first-child > span:last-child .btn { min-height: 44px; width: 100%; }
    /* hinnakirja read: 1 Kood · 2 Toode · 3 Kategooria · 4 Hind · 5 Min kogus (+ kategooria vaheread) */
    #priceListsList .order-card > div:nth-child(2) { padding: 10px 10px !important; }
    #priceListsList table.m-kaardid tr {
        grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "kd hn" "nm hn" "kt mn";
        gap: 2px 12px; padding: 10px 12px; margin-bottom: 6px; box-shadow: none; border-radius: 10px;
    }
    #priceListsList table.m-kaardid tr > td { order: 0 !important; font-weight: 400; }
    #priceListsList table.m-kaardid tr > td:nth-child(1) { grid-area: kd; font-size: 0.8rem; color: var(--m-hall); }
    #priceListsList table.m-kaardid tr > td:nth-child(2) { grid-area: nm; font-size: 0.92rem; }
    #priceListsList table.m-kaardid tr > td:nth-child(3) { grid-area: kt; }
    #priceListsList table.m-kaardid tr > td:nth-child(4) { grid-area: hn; justify-self: end; align-self: center; white-space: nowrap !important; font-variant-numeric: tabular-nums; }
    #priceListsList table.m-kaardid tr > td:nth-child(5) { grid-area: mn; justify-self: end; text-align: right !important; font-size: 0.8rem; }
    #priceListsList table.m-kaardid tr > td:is(:nth-child(1), :nth-child(2), :nth-child(3), :nth-child(4))::before { display: none; }
    #priceListsList table.m-kaardid tr > td.m-lai {
        grid-column: 1 / -1 !important; grid-area: auto; font-family: var(--font-display, Georgia, serif); font-size: 0.95rem;
    }
    #priceListsList table.m-kaardid tr:has(> td.m-lai) {
        display: block; background: transparent !important; border: 0; padding: 10px 2px 4px; margin: 4px 0 0;
    }
    /* muutmisvaade: rida = toode täislaiuses, hind + min + X all */
    #priceListsList .order-line-row { display: grid !important; grid-template-columns: 1fr 1fr 48px; gap: 6px; margin-bottom: 10px; }
    #priceListsList .order-line-row > .epli-product { grid-column: 1 / -1; width: 100% !important; }
    #priceListsList .order-line-row > input { width: 100% !important; }
    #priceListsList .order-card > div:nth-child(2) > div[style*="display:flex"]:has(> span[style*="flex:3"]) { display: none !important; }

    /* ── Kliendid (#partnerPlatvorm müügi pesas; Stitch m10) ─────────────── */
    /* 1 Kood · 2 Nimi · 3 Liik · 4 Tüüp · 5 Riik · 6 Reg.kood · 7 VAT · 8 Email · 9 Telefon · 10 Tarnekohti */
    #salesWholesaleSlot #partnersList > table.m-kaardid > tbody > tr {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        grid-template-areas: "nm nm lk" "kd rg tp" "vt rk tk" "em em em" "tl tl tl";
        gap: 6px 10px; padding: 14px 16px; align-items: start;
    }
    #salesWholesaleSlot #partnersList > table.m-kaardid > tbody > tr > td { order: 0 !important; font-weight: 400; font-size: 0.86rem; }
    #salesWholesaleSlot #partnersList > table.m-kaardid > tbody > tr > td:nth-child(1) { grid-area: kd; }
    #salesWholesaleSlot #partnersList > table.m-kaardid > tbody > tr > td:nth-child(2) {
        grid-area: nm; font-family: var(--font-display, Georgia, serif); font-size: 1.15rem; line-height: 1.25;
    }
    #salesWholesaleSlot #partnersList > table.m-kaardid > tbody > tr > td:nth-child(2)::before { display: none; }
    #salesWholesaleSlot #partnersList > table.m-kaardid > tbody > tr > td:nth-child(3) { grid-area: lk; justify-self: end; }
    #salesWholesaleSlot #partnersList > table.m-kaardid > tbody > tr > td:nth-child(3)::before { display: none; }
    #salesWholesaleSlot #partnersList > table.m-kaardid > tbody > tr > td:nth-child(4) { grid-area: tp; justify-self: end; text-align: right !important; }
    #salesWholesaleSlot #partnersList > table.m-kaardid > tbody > tr > td:nth-child(5) { grid-area: rk; }
    #salesWholesaleSlot #partnersList > table.m-kaardid > tbody > tr > td:nth-child(6) { grid-area: rg; }
    #salesWholesaleSlot #partnersList > table.m-kaardid > tbody > tr > td:nth-child(7) { grid-area: vt; }
    #salesWholesaleSlot #partnersList > table.m-kaardid > tbody > tr > td:nth-child(8) { grid-area: em; }
    #salesWholesaleSlot #partnersList > table.m-kaardid > tbody > tr > td:nth-child(9) { grid-area: tl; }
    #salesWholesaleSlot #partnersList > table.m-kaardid > tbody > tr > td:nth-child(10) { grid-area: tk; justify-self: end; text-align: right !important; }
    #salesWholesaleSlot #partnersList > table.m-kaardid > tbody > tr > td:is(:nth-child(3), :nth-child(4)) span {
        display: inline-block; border-radius: 999px !important; padding: 2px 9px !important; font-size: 0.72rem !important; margin: 0 0 2px 2px;
    }
    #salesWholesaleSlot #partnersList > table.m-kaardid td.m-myyk-tuhi { display: none; }
    /* e-poe kliendid (6 veergu: Kood · Nimi · Liik · Riik · Email · Telefon) */
    #salesWholesaleSlot #partnersList.m-myyk-epoe > table.m-kaardid > tbody > tr {
        grid-template-areas: "nm nm lk" "kd rk rk" "em em em" "tl tl tl";
    }
    #salesWholesaleSlot #partnersList.m-myyk-epoe > table.m-kaardid > tbody > tr > td:nth-child(4) { grid-area: rk; justify-self: start; text-align: left !important; }
    #salesWholesaleSlot #partnersList.m-myyk-epoe > table.m-kaardid > tbody > tr > td:nth-child(5) { grid-area: em; }
    #salesWholesaleSlot #partnersList.m-myyk-epoe > table.m-kaardid > tbody > tr > td:nth-child(6) { grid-area: tl; }
    #salesWholesaleSlot #partnerPlatvorm > div:first-child > h2 { font-family: var(--font-display, Georgia, serif); font-size: 1.35rem; }
    #salesWholesaleSlot #partnerPlatvorm > div:first-child > div { width: 100%; }
    #salesWholesaleSlot #partnerPlatvorm > div:first-child > div > .btn { flex: 1 1 auto; min-height: 44px; }
    #salesWholesaleSlot #partnerPlatvorm > div:nth-of-type(2) > select { flex: 1 1 calc(50% - 4px); min-width: 0; }
    #salesWholesaleSlot #partnerCount { flex: 1 1 100%; }

    /* ── Meeldetuletused / Arveldusseis ──────────────────────────────────── */
    #salesReminders > div:nth-of-type(2) > .btn, #salesReminders .btn { min-height: 44px; }
    /* KPI-kaardid (summad tulevad serverist, siin ainult paigutus): 2 + 1 täislaiuses, mitte 3 kitsast */
    #salesBilling div[style*="min-width:160px"], #salesBilling div[style*="min-width:150px"] { flex: 1 1 calc(50% - 6px) !important; }
    #salesBilling div[style*="min-width:160px"][style*="#5c4033"], #salesBilling div[style*="min-width:150px"][style*="#5c4033"] { flex-basis: 100% !important; }
    #salesBilling div[style*="min-width:160px"] > div:nth-child(2), #salesBilling div[style*="min-width:150px"] > div:nth-child(2) {
        font-size: 1.2rem !important; white-space: nowrap; font-variant-numeric: tabular-nums;
    }
    #salesBilling #billSearch { flex: 1 1 100% !important; }

    /* ── Partneri-ala ────────────────────────────────────────────────────── */
    #partner > .tab-bar label, #partner > .tab-bar select { flex: 0 0 auto; }
    #partner > .tab-bar select { min-height: 38px; width: auto; }
}
