/* =====================================================================
   Janab mağaza paneli — dizayn sistemi
   Mövzu: kişi geyimi. Kostyum yunu (göy), tunc düymə-sap (aksent),
   dəri (qırmızı), mamır (yaşıl). Ölçülər — paltarın toxunma etiketi kimi.
   ===================================================================== */

@font-face {
    font-family: "Geologica";
    font-style: normal; font-display: swap; font-weight: 100 900;
    src: url(../fonts/geologica-cyrillic-ext-wght-normal.woff2) format("woff2-variations");
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: "Geologica";
    font-style: normal; font-display: swap; font-weight: 100 900;
    src: url(../fonts/geologica-cyrillic-wght-normal.woff2) format("woff2-variations");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: "Geologica";
    font-style: normal; font-display: swap; font-weight: 100 900;
    src: url(../fonts/geologica-latin-ext-wght-normal.woff2) format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Geologica";
    font-style: normal; font-display: swap; font-weight: 100 900;
    src: url(../fonts/geologica-latin-wght-normal.woff2) format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* Rənglər */
    --wool: #16213A;          /* kostyum yunu: başlıq, əsas düymə, güclü mətn */
    --wool-2: #22314F;        /* hover */
    --wool-3: #34466B;
    --brass: #B7893C;         /* tunc: aksent, fokus, sıra nömrəsi */
    --brass-2: #9A7230;
    --brass-soft: #F5EBD9;
    --tag: #FBF7EE;           /* ölçü etiketi fonu (fil sümüyü) */
    --tag-line: #D7C49C;      /* etiketin tikişi */
    --chalk: #ECEFF3;         /* səhifə fonu: soyuq təbaşir */
    --paper: #FFFFFF;
    --ink: #172033;
    --muted: #687287;
    --faint: #98A0B0;
    --line: #DDE2E9;
    --line-2: #EBEEF2;
    --moss: #3C6A4D;  --moss-soft: #E4EFE7;
    --amber: #9A6510; --amber-soft: #FAEFD9;
    --ox: #8C2F39;    --ox-soft: #F7E4E5;
    --sky: #2D4F86;   --sky-soft: #E5ECF7;

    /* Forma */
    --r-lg: 16px;   /* bölmələr */
    --r-md: 10px;   /* daxili bloklar, sahələr */
    --r-sm: 6px;    /* düymələr, nişanlar */
    --r-tag: 3px;   /* ölçü etiketi */
    --lift: 0 1px 0 rgba(22, 33, 58, .04), 0 8px 24px -12px rgba(22, 33, 58, .18);
    --tabbar-h: 64px;

    /* köhnə adlar (səhifələrdə birbaşa işlənir) */
    --accent: var(--wool); --accent-soft: var(--sky-soft);
    --ok: var(--moss); --ok-soft: var(--moss-soft);
    --warn: var(--amber); --warn-soft: var(--amber-soft);
    --err: var(--ox); --err-soft: var(--ox-soft);
    --bg: var(--chalk); --card: var(--paper);

    --font: "Geologica", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
    background: var(--chalk);
    color: var(--ink);
    font: 400 14.5px/1.5 var(--font);
    font-feature-settings: "tnum" 1;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--sky); text-underline-offset: 2px; }
b, strong { font-weight: 650; }
::selection { background: var(--brass-soft); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
main.page { padding-top: 26px; padding-bottom: 72px; }

/* ---------------------------------------------------------------- Başlıq */
.top {
    position: sticky; top: 0; z-index: 30;
    color: #fff;
    background-color: var(--wool);
    /* kostyum parçasının toxuması (twill) */
    background-image:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 5px),
        repeating-linear-gradient(-45deg, rgba(0, 0, 0, .12) 0 1px, transparent 1px 7px);
    box-shadow: inset 0 -1px 0 rgba(183, 137, 60, .45);
}
.top-in { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: baseline; gap: 10px; color: #fff; text-decoration: none; white-space: nowrap; }
.brand-mark { font-weight: 800; font-size: 19px; letter-spacing: .32em; margin-right: -.32em; }
.brand-sub { font-size: 12.5px; color: rgba(255, 255, 255, .55); font-weight: 400; }
.top-nav { display: flex; gap: 2px; flex: 1; }
.top-nav a {
    position: relative; color: rgba(255, 255, 255, .72); text-decoration: none;
    padding: 8px 13px; border-radius: var(--r-sm); font-weight: 500; white-space: nowrap;
}
.top-nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.top-nav a.active { color: #fff; }
.top-nav a.active::after {
    content: ""; position: absolute; left: 13px; right: 13px; bottom: -11px; height: 2px; background: var(--brass); border-radius: 2px;
}
.logout { display: flex; align-items: center; gap: 12px; }
.user { color: rgba(255, 255, 255, .6); font-size: 13px; }
.logout-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--r-sm);
    background: transparent; color: rgba(255, 255, 255, .85); border: 1px solid rgba(255, 255, 255, .18); font: inherit; font-size: 13px; cursor: pointer;
}
.logout-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.logout-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Aşağı naviqasiya (telefon) */
.tabbar { display: none; }

/* ---------------------------------------------------------------- Mətn */
h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; color: var(--wool); }
h2 { font-size: 17px; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; margin: 0 0 12px; color: var(--wool); }
.sub { color: var(--muted); margin: 0 0 22px; max-width: 75ch; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- Bölmələr */
.card {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 20px 22px; margin-bottom: 16px;
}
.grid { display: grid; gap: 14px; }
.grid > *, .filter-grid > * { min-width: 0; }
input, select { min-width: 0; max-width: 100%; }
input[type=date] { display: block; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

/* Göstəricilər */
.stat {
    position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 16px 18px 14px; overflow: hidden;
}
.stat b { display: block; font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; color: var(--wool); margin-bottom: 4px; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat.hero {
    background-color: var(--wool); border-color: var(--wool); color: #fff;
    background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 5px);
}
.stat.hero b { color: #fff; }
.stat.hero span { color: rgba(255, 255, 255, .7); }
.stat.hero::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px; background: var(--brass); border-radius: 3px 3px 0 0; }
.stat b.inline { display: inline; font-size: inherit; letter-spacing: 0; color: inherit; }
.stat-btn { text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.stat-btn:hover { border-color: var(--wool-3); box-shadow: var(--lift); }

/* ---------------------------------------------------------------- Forma */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--ink); }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 5px; }
input[type=date], input[type=number], input[type=text], input[type=password], input[type=search], select {
    width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-md);
    font: inherit; font-size: 14.5px; background: #fff; color: var(--ink);
    transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
select {
    padding-right: 34px; cursor: pointer;
    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='%23687287' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: #C9D0DA; }
input:focus, select:focus { outline: none; border-color: var(--wool-3); box-shadow: 0 0 0 3px rgba(183, 137, 60, .22); }
input[type=checkbox] {
    appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; flex: 0 0 18px;
    border: 1.5px solid #B9C1CD; border-radius: 5px; background: #fff; cursor: pointer; position: relative; vertical-align: middle;
    transition: background .12s, border-color .12s;
}
input[type=checkbox]:checked { background: var(--wool); border-color: var(--wool); }
input[type=checkbox]:checked::after {
    content: ""; position: absolute; left: 5px; top: 1.5px; width: 5px; height: 10px;
    border: solid var(--brass); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; margin: 8px 0; cursor: pointer; }
.check input { margin-top: 2px; }

/* Düymələr */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
    border-radius: var(--r-md); border: 1px solid var(--wool); background: var(--wool); color: #fff;
    font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--wool-2); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--wool); border-color: #C9D0DA; }
.btn.secondary:hover { border-color: var(--wool); background: #fff; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn.danger { background: #fff; color: var(--ox); border-color: #E2C3C6; }
.btn.danger:hover { border-color: var(--ox); }
.btn:disabled { opacity: .45; cursor: default; }
/* Əsas əməliyyat: tunc xətt ilə */
form > .row.end .btn:not(.secondary), .btn.primary { box-shadow: inset 0 -2px 0 var(--brass); }
.link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--sky); text-decoration: underline; text-underline-offset: 2px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink);
    cursor: pointer; font: inherit; font-size: 13px; white-space: nowrap; transition: border-color .12s, background .12s;
}
.chip:hover { border-color: var(--wool-3); }
.chip:disabled { opacity: .4; cursor: default; }

/* ---------------------------------------------------------------- Cədvəllər */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: #F8F9FB; white-space: nowrap; }
td.num, th.num { text-align: right; }
td.c, th.c { text-align: center; }
tbody tr:hover td { background: #FAFBFC; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card > .table-scroll:first-child table tr:first-child th:first-child { border-top-left-radius: var(--r-lg); }

/* ---------------------------------------------------------------- Nişanlar */
.badge {
    display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px;
    font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.ok { background: var(--moss-soft); color: var(--moss); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.err { background: var(--ox-soft); color: var(--ox); }
.badge.info { background: var(--sky-soft); color: var(--sky); }

.flash {
    padding: 12px 16px; border-radius: var(--r-md); background: var(--moss-soft); color: var(--moss);
    margin-bottom: 16px; border: 1px solid #CFE1D5; font-weight: 500;
}
.flash.error { background: var(--ox-soft); color: var(--ox); border-color: #EBCBCE; white-space: pre-wrap; }

/* ---------------------------------------------------------------- Ölçü etiketi
   Paltarın içindəki toxunma ölçü etiketi: fil sümüyü fon, tunc "tikiş". */
.sz, .buy-chip, .mx, .det-sizes th:not(:first-child), .plan-table th:not(:first-child) { --stitch: var(--tag-line); }
.sz {
    display: inline-flex; align-items: baseline; gap: 5px; padding: 2px 8px; border-radius: var(--r-tag);
    background: var(--tag); color: var(--wool); font-size: 12px; font-weight: 500; white-space: nowrap;
    box-shadow: inset 0 0 0 1px var(--tag-line);
    outline: 1px dashed var(--tag-line); outline-offset: -4px;
}
.sz b { font-weight: 700; }
.sz.out { background: var(--ox-soft); color: var(--ox); box-shadow: inset 0 0 0 1px #E4B9BE; outline-color: #E4B9BE; }
.buy-chip {
    display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: var(--r-tag);
    background: var(--wool); color: rgba(255, 255, 255, .75); font-size: 12px; white-space: nowrap;
    outline: 1px dashed rgba(183, 137, 60, .75); outline-offset: -4px;
}
.buy-chip b { color: #fff; font-size: 14px; font-weight: 700; }
.stc {
    display: inline-flex; gap: 5px; padding: 2px 8px; border-radius: var(--r-sm); font-size: 12px; white-space: nowrap;
    background: var(--moss-soft); color: var(--moss);
}
.stc.cur { box-shadow: inset 0 0 0 1.5px var(--moss); }
.stc.muted-chip { background: var(--line-2); color: var(--ink); }
.chips-sm { display: flex; flex-wrap: wrap; gap: 5px; }
.chips-sm.one-line { flex-wrap: nowrap; overflow: hidden; max-width: 340px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }

/* ---------------------------------------------------------------- Açılan bloklar */
.pair { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); margin-bottom: 12px; overflow: hidden; }
.pair > summary {
    list-style: none; cursor: pointer; padding: 14px 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    transition: background .15s;
}
.pair > summary::-webkit-details-marker { display: none; }
.pair > summary::before {
    content: ""; width: 8px; height: 8px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted);
    transform: rotate(-45deg); transition: transform .2s; margin-right: 2px; flex: 0 0 auto;
}
.pair[open] > summary::before { transform: rotate(45deg); }
.pair > summary:hover { background: #FAFBFC; }
.pair[open] > summary { border-bottom: 1px solid var(--line-2); }
.pair > summary .route { font-weight: 650; color: var(--wool); font-size: 15.5px; }
.pair > summary .route .arrow { color: var(--brass); padding: 0 8px; font-weight: 400; }
.pair .body { padding: 0 0 6px; }
.pair .body table { min-width: 820px; }
.sender-group > .row h2 { font-size: 18px; }

/* Sekmələr */
.tabs { display: flex; gap: 4px; margin: 4px 0 18px; padding: 4px; background: #E2E6EC; border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tab {
    background: none; border: 0; padding: 9px 16px; font: inherit; font-weight: 600; color: var(--muted);
    cursor: pointer; white-space: nowrap; border-radius: 9px; transition: background .15s, color .15s;
}
.tab .muted { font-weight: 500; margin-left: 4px; }
.tab.active { background: #fff; color: var(--wool); box-shadow: 0 1px 2px rgba(22, 33, 58, .12); }
.tab:hover:not(.active) { color: var(--ink); }

/* Filtr paneli */
.filters { position: sticky; top: 72px; z-index: 10; box-shadow: var(--lift); }
.filter-grid { display: grid; gap: 12px; grid-template-columns: 2fr repeat(5, 1fr); }
.top-grid { grid-template-columns: 2fr repeat(5, minmax(0, 1fr)); }
.sales-grid { grid-template-columns: 2fr 1.2fr 1.6fr 1.2fr 1.4fr; }
.cols-pick { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.cols-pick label { display: inline-flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; font-size: 13.5px; cursor: pointer; }
.store-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 18px; }

/* İrəliləyiş */
.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin: 16px 0; }
.progress > div { height: 100%; width: 32%; background: linear-gradient(90deg, var(--wool), var(--brass)); border-radius: 2px; animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -32%; } 100% { margin-left: 100%; } }

pre.json { background: var(--wool); color: #DCE3EE; padding: 14px; border-radius: var(--r-md); overflow: auto; max-height: 440px; font-size: 12px; line-height: 1.55; }

/* ---------------------------------------------------------------- Giriş */
body.guest {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background-color: var(--wool);
    background-image:
        radial-gradient(1200px 600px at 20% -10%, rgba(183, 137, 60, .16), transparent 60%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 5px),
        repeating-linear-gradient(-45deg, rgba(0, 0, 0, .14) 0 1px, transparent 1px 7px);
}
body.guest main.page { width: 100%; padding: 24px 16px; }
.login { max-width: 380px; margin: 0 auto; padding: 30px 28px 26px; border: 0; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); }
.login .brand-big { font-weight: 800; letter-spacing: .38em; color: var(--wool); font-size: 24px; margin-bottom: 2px; }
.login .sub { margin-bottom: 24px; }
.login .btn { width: 100%; height: 46px; box-shadow: inset 0 -2px 0 var(--brass); }

/* ---------------------------------------------------------------- Ən çox satılanlar */
.top-table { min-width: 760px; }
.top-table th.sortable { cursor: pointer; user-select: none; }
.top-table th.sortable:hover { color: var(--wool); }
.top-table tr.selrow { cursor: pointer; }
.top-table tr.selrow td { vertical-align: middle; }
.top-table tr.selrow:hover td { background: #F7F9FC; }
.top-table td.rk { color: var(--brass-2); font-weight: 700; width: 44px; }
.top-table td.nm b { color: var(--wool); font-weight: 600; }
.top-table td.sel { width: 52px; }
.top-table td.sel input { width: 20px; height: 20px; }
.top-table td.sel input:checked::after { left: 6px; top: 2px; }
.top-table tr.picked td { background: #F3F6FB; }
.top-table tr.picked td.sel { box-shadow: inset 3px 0 0 var(--brass); }
.top-table tr.open td { background: #F1F4F9; border-bottom-color: transparent; }
.top-table td.arrow { color: var(--faint); width: 36px; font-size: 13px; }
.top-table tr.open td.arrow { color: var(--brass); }
.top-table tr.detail td { background: #F1F4F9; padding: 2px 18px 18px; }
.top-table tr.detail:hover td { background: #F1F4F9; }
.top-table tfoot tr.tot td { background: var(--brass-soft); border-top: 1px solid var(--tag-line); font-weight: 600; }
.mx-h { min-width: 44px; }
.mx b { display: block; font-size: 14px; color: var(--wool); }
.mx-s { display: block; font-size: 11px; color: var(--faint); }
.mx-s.out { color: var(--ox); font-weight: 700; }

.det { display: flex; flex-direction: column; gap: 14px; animation: reveal .22s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.det-h { font-size: 13px; color: var(--wool); font-weight: 650; margin-bottom: 6px; }
.det-sizes, .det-stores { width: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); border-collapse: separate; border-spacing: 0; overflow: clip; }
.det-sizes th, .det-sizes td { padding: 6px 10px; font-size: 13px; min-width: 46px; }
.det-sizes th:not(:first-child) { background: var(--tag); color: var(--wool); font-weight: 700; border-bottom: 1px dashed var(--tag-line); }
.det-sizes td.neg { color: var(--ox); font-weight: 700; }
.det-stores { min-width: 540px; }
.det-stores th, .det-stores td { padding: 7px 12px; font-size: 13px; vertical-align: middle; }
.det-stores tr.cur td { background: var(--moss-soft); }

/* Alış planı */
.planner { border-left: 0; position: relative; overflow: hidden; }
.planner::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brass); }
.planner h2 { margin: 0; }
.plan-table { margin-top: 12px; width: auto; border: 1px solid var(--line); border-radius: var(--r-md); border-collapse: separate; border-spacing: 0; overflow: clip; }
.plan-table th, .plan-table td { padding: 7px 12px; font-size: 13px; }
.plan-table th:not(:first-child) { background: var(--tag); color: var(--wool); font-weight: 700; border-bottom: 1px dashed var(--tag-line); }
.plan-table tr.buy td { background: var(--wool); color: #fff; font-size: 15px; border-bottom: 0; }
.plan-table tr.buy td:first-child { color: var(--brass); }
.plan-table td.neg { color: var(--ox); font-weight: 700; }
.sel-item { display: grid; grid-template-columns: minmax(200px, 1.3fr) 100px 3fr 28px; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-2); }
.sel-name b { color: var(--wool); }
.sel-item .sel-qty { height: 40px; text-align: center; font-weight: 700; font-size: 16px; }
.sel-x { font-size: 22px; line-height: 1; text-decoration: none; color: var(--faint); }
.sel-x:hover { color: var(--ox); }

/* Satış yoxlaması */
.sales-table { min-width: 1150px; }
.sales-table td { font-size: 13px; }
.sales-table td.neg { color: var(--ox); }
.sales-table td.pos { color: var(--amber); }
.sales-table tr.st-cheap td:first-child { box-shadow: inset 3px 0 0 var(--ox); }
.sales-table tr.st-exp td:first-child { box-shadow: inset 3px 0 0 #C9922B; }
.store-sum tr[data-store] td:first-child b { color: var(--wool); }

/* =====================================================================
   Telefon
   ===================================================================== */
@media (max-width: 1100px) {
    .top-nav a { padding: 8px 9px; }
    .top-nav a.active::after { left: 9px; right: 9px; }
    .brand-sub, .user { display: none; }
    .top-in { gap: 18px; }
}
@media (max-width: 960px) {
    .top-nav { gap: 0; }
    .top-nav a { padding: 8px 7px; font-size: 13.5px; }
    .top-nav a.active::after { left: 7px; right: 7px; }
    .logout-btn span { display: none; }
    .logout-btn { padding: 7px; }
}
@media (max-width: 980px) {
    .filter-grid, .top-grid, .sales-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .f-search { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    body { font-size: 15px; }
    .wrap { padding: 0 14px; }
    main.page { padding-top: 16px; padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }

    /* yuxarı: yalnız marka və çıxış; bölmələr aşağıda */
    .top-in { height: 52px; gap: 12px; }
    .top { padding-top: env(safe-area-inset-top); }
    .top-nav { display: none; }
    .brand { flex: 1; }
    .brand-mark { font-size: 17px; }
    .user { display: none; }
    .logout-btn span { display: none; }
    .logout-btn { padding: 7px; border: 0; }
    .logout-btn svg { width: 20px; height: 20px; }

    .tabbar {
        display: grid; grid-template-columns: repeat(5, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
        height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
        background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
        border-top: 1px solid var(--line);
    }
    .tabbar a {
        position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        color: var(--muted); text-decoration: none; font-size: 10.5px; font-weight: 600;
    }
    .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
    .tabbar a.active { color: var(--wool); }
    .tabbar a.active svg { stroke-width: 2.1; }
    .tabbar a.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brass); }

    h1 { font-size: 22px; }
    h2 { font-size: 16px; }
    .sub { font-size: 14px; margin-bottom: 16px; }
    .card { padding: 16px; border-radius: 14px; }
    .grid.four { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat { padding: 13px 14px 12px; border-radius: 14px; }
    .stat b { font-size: 23px; }
    .filter-grid, .top-grid, .sales-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .filters { position: static; box-shadow: none; }
    input[type=date], input[type=number], input[type=text], input[type=password], input[type=search], select { height: 46px; font-size: 16px; } /* iOS böyütməsin */
    .btn { height: 46px; }
    .btn.small { height: 36px; }
    .chip { height: 36px; }
    .row.end { justify-content: stretch; }
    .row.end .btn { flex: 1; }
    .row.end > .muted { flex: 1 0 100%; }
    .cols-pick label { font-size: 14px; }
    .tabs { width: 100%; }
    .tab { flex: 1; padding: 10px 8px; }
    .pair > summary { padding: 13px 14px; }
    .store-checks { grid-template-columns: 1fr 1fr; }
    .login { padding: 26px 22px; }

    /* Geniş cədvəllər telefonda kart kimi */
    .top-table, .sales-table { min-width: 0; }
    .top-table thead, .sales-table thead { display: none; }
    .top-table, .top-table > tbody, .top-table > tfoot, .top-table > tbody > tr, .top-table > tfoot > tr,
    .top-table > tbody > tr > td, .top-table > tfoot > tr > td,
    .sales-table, .sales-table > tbody, .sales-table > tbody > tr, .sales-table > tbody > tr > td { display: block; width: 100%; }
    .top-table > tbody > tr, .sales-table > tbody > tr { padding: 12px 14px; border-bottom: 1px solid var(--line); position: relative; }
    .top-table > tbody > tr > td, .top-table > tfoot > tr > td, .sales-table > tbody > tr > td {
        border: 0; padding: 3px 0; text-align: right; overflow: hidden; background: none !important;
    }
    .top-table > tbody > tr > td::before, .top-table > tfoot > tr > td::before, .sales-table > tbody > tr > td::before {
        content: attr(data-label); float: left; margin-right: 12px; color: var(--muted); font-size: 12.5px; text-align: left; padding-top: 1px;
    }
    .top-table td:empty { display: none; }
    .top-table > tbody > tr > td.rk { display: inline-block; width: auto; font-size: 13px; padding-right: 8px; }
    .top-table > tbody > tr > td.nm { display: inline; width: auto; text-align: left; font-size: 15px; }
    .top-table > tbody > tr > td.rk::before, .top-table > tbody > tr > td.nm::before { content: none; }
    .top-table > tbody > tr > td.nm b { display: inline; }
    .top-table > tbody > tr > td.rk + td.nm + td { margin-top: 6px; }
    .top-table > tbody > tr > td.sel { position: absolute; top: 10px; right: 12px; width: auto; padding: 0; }
    .top-table > tbody > tr > td.sel::before { content: none; }
    .top-table > tbody > tr > td.arrow { display: none; }
    .top-table > tbody > tr.selrow { padding-right: 52px; }
    .top-table > tbody > tr.selrow > td:not(.sel) { padding-right: 0; }
    .top-table > tbody > tr.picked { box-shadow: inset 4px 0 0 var(--brass); }
    .top-table > tbody > tr.picked, .top-table > tbody > tr.open { background: #F3F6FB; }
    .top-table tr.picked td.sel { box-shadow: none; }
    .top-table td .chips-sm { justify-content: flex-end; }
    .chips-sm.one-line { max-width: 220px; margin-left: auto; }
    /* ölçü sütunları: yan-yana etiketlər */
    .top-table > tbody > tr > td.mx, .top-table > tfoot > tr > td.mx {
        display: inline-flex; flex-direction: column; align-items: center; width: auto; min-width: 48px; margin: 6px 6px 0 0; padding: 5px 7px 4px;
        background: var(--tag) !important; border-radius: var(--r-tag); text-align: center;
        box-shadow: inset 0 0 0 1px var(--tag-line); outline: 1px dashed var(--tag-line); outline-offset: -4px;
    }
    .top-table > tbody > tr > td.mx::before, .top-table > tfoot > tr > td.mx::before { float: none; margin: 0; font-size: 11px; padding: 0; color: var(--brass-2); font-weight: 700; text-align: center; }
    .top-table > tbody > tr > td.mx.mx-empty { display: none; }
    .top-table > tfoot > tr.tot { background: var(--brass-soft); padding: 12px 14px; }
    .top-table > tfoot > tr.tot > td { text-align: left; }
    /* açılan detal */
    .top-table > tbody > tr.detail { padding: 0 14px 16px; background: #F3F6FB; margin-top: -1px; }
    .top-table > tbody > tr.detail > td { padding: 0; text-align: left; }
    .top-table > tbody > tr.detail > td::before { content: none; }
    .det-stores { min-width: 420px; width: 100%; }
    .det-sizes { width: 100%; }
    .det .table-scroll { margin: 0 -2px; }

    .sales-table > tbody > tr > td.nm { text-align: left; font-weight: 650; color: var(--wool); padding-bottom: 6px; font-size: 15px; }
    .sales-table > tbody > tr > td.nm::before { content: none; }
    .sales-table > tbody > tr > td.nm .muted { font-weight: 400; }
    .sales-table > tbody > tr.st-cheap { box-shadow: inset 4px 0 0 var(--ox); }
    .sales-table > tbody > tr.st-exp { box-shadow: inset 4px 0 0 #C9922B; }
    .sales-table tr td:first-child { box-shadow: none !important; }

    /* səhifə başlığı + düymələr */
    main.page > .row:first-child { gap: 8px; }
    main.page > .row:first-child > h1 { flex: 1 0 100%; }
    main.page > .row:first-child > .spacer { display: none; }
    main.page > .row:first-child > .btn, main.page > .row:first-child > form { flex: 1 1 auto; }
    main.page > .row:first-child > form .btn { width: 100%; }
    #p-global .row > div { flex: 1 1 100% !important; }
    .sel-item { grid-template-columns: 1fr 86px 28px; gap: 10px; }
    .sel-item .sel-res { grid-column: 1 / -1; grid-row: 2; }
    .plan-table th, .plan-table td { padding: 7px 9px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Say xanası (avtomatik yadda saxlanılır) */
input.qty { width: 68px; height: 36px; padding: 0 8px; text-align: center; font-weight: 700; }
.qty-st { display: inline-block; min-width: 18px; margin-left: 6px; font-size: 12px; vertical-align: middle; }
.qty-st.ok { color: var(--moss); font-weight: 700; }
.qty-st.busy { color: var(--faint); }
.qty-st.err { color: var(--ox); font-weight: 600; }
tr.fl.zero td { opacity: .45; }
tr.fl.zero td.l-qty { opacity: 1; }
tr.fl.zero td.l-name { text-decoration: line-through; }
.outlet-opts { margin: 2px 0 10px 28px; padding: 10px 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 760px) { .outlet-opts { margin-left: 8px; } }
.note-outlet { font-size: 13.5px; border-left: 0; position: relative; overflow: hidden; }
.note-outlet::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ox); }

/* Brend prioriteti */
.brand-rule { margin-top: 4px; }
.brand-opts { margin: 2px 0 10px 28px; padding: 10px 14px; border-left: 2px solid var(--line); }
.prio { display: flex; flex-wrap: wrap; gap: 8px; }
.prio-chip {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 6px; border-radius: 999px;
    border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer;
}
.prio-chip i { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
    font-style: normal; font-weight: 700; font-size: 12px; background: var(--line-2); color: var(--faint); }
.prio-chip.on { border-color: var(--wool); background: var(--wool); color: #fff; }
.prio-chip.on i { background: var(--brass); color: var(--wool); }
@media (max-width: 760px) { .brand-opts { margin-left: 8px; } }

/* =====================================================================
   Telefon: kart cədvəllər, seçim pəncərəsi, yığılan filtrlər
   ===================================================================== */
.filters-toggle { display: none; }
table.lines td.l-snd, table.lines td.l-rcv { white-space: nowrap; }
.m-only { display: none; }

@media (max-width: 760px) {
    .m-hide { display: none !important; }

    /* ---- Ümumi kart cədvəl (.m-cards) */
    table.m-cards, table.m-cards > tbody, table.m-cards > tbody > tr, table.m-cards > tbody > tr > td { display: block; width: 100%; }
    table.m-cards > thead { display: none; }
    table.m-cards > tbody > tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
    table.m-cards > tbody > tr:last-child { border-bottom: 0; }
    table.m-cards > tbody > tr:hover > td { background: none; }
    table.m-cards > tbody > tr > td { border: 0; padding: 3px 0; text-align: right; overflow: hidden; }
    table.m-cards > tbody > tr > td[data-label]::before {
        content: attr(data-label); float: left; margin-right: 12px; color: var(--muted); font-size: 12.5px; padding-top: 1px; text-align: left;
    }
    table.m-cards > tbody > tr > td.m-title { text-align: left; font-weight: 650; font-size: 15.5px; color: var(--wool); padding-bottom: 6px; }
    table.m-cards > tbody > tr > td.m-title a { font-weight: 650; }
    table.m-cards > tbody > tr > td.m-actions { padding-top: 8px; text-align: left; }
    table.m-cards > tbody > tr > td.m-actions .btn { width: 100%; }
    .card > .table-scroll > table.m-cards { min-width: 0; }

    /* analiz: filial seçimi — ad + qrup bir sətirdə, altında iki keçid */
    table.store-pick > tbody > tr { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 6px; align-items: center; }
    table.store-pick > tbody > tr > td.m-title { padding: 0; font-size: 15px; }
    table.store-pick > tbody > tr > td.m-badge { padding: 0; width: auto; }
    table.store-pick > tbody > tr > td.m-toggle {
        display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left;
        border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px; background: #fff;
    }
    table.store-pick > tbody > tr > td.m-toggle::before { float: none; margin: 0; font-size: 13.5px; color: var(--ink); font-weight: 500; }
    table.store-pick > tbody > tr > td.m-toggle input { width: 22px; height: 22px; flex-basis: 22px; }
    table.store-pick > tbody > tr > td.m-toggle input:checked::after { left: 6.5px; top: 2.5px; width: 6px; height: 11px; }

    /* filiallar səhifəsi: sahələr tam en */
    table.stores-edit > tbody > tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
    table.stores-edit > tbody > tr > td.m-title { grid-column: 1 / -1; padding: 0 0 2px; }
    table.stores-edit > tbody > tr > td.m-field { grid-column: 1 / -1; padding: 0; text-align: left; }
    table.stores-edit > tbody > tr > td.m-field.m-half { grid-column: auto; }
    table.stores-edit > tbody > tr > td.m-field::before { float: none !important; display: block; margin: 0 0 4px !important; }

    /* ---- Forma şəbəkələri */
    .store-checks { grid-template-columns: 1fr; }
    .one-line { max-width: none !important; }
    .chips-sm.one-line { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; margin-left: 0; }
    .top-table td .chips-sm { justify-content: flex-end; }

    /* ---- Yığılan filtrlər */
    .filters-toggle {
        display: flex; align-items: center; gap: 10px; grid-column: 1 / -1; width: 100%; height: 46px; padding: 0 14px;
        border: 1px solid var(--line); border-radius: var(--r-md); background: #F8F9FB; color: var(--wool);
        font: inherit; font-weight: 600; cursor: pointer;
    }
    .filters-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
    .filters-toggle .fcount { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--wool); background: var(--brass-soft); padding: 2px 9px; border-radius: 999px; }
    .filters-toggle .fcount:empty { display: none; }
    .filters-toggle .fcount:empty + .chev { margin-left: auto; }
    .filters-toggle .chev { transition: transform .2s; }
    .filters.open .filters-toggle .chev { transform: rotate(180deg); }
    .filters.collapsible:not(.open) .filter-grid > :not(.f-search):not(.filters-toggle),
    .filters.collapsible:not(.open) .cols-pick { display: none; }
    .filters.collapsible .filter-grid { gap: 10px; }

    /* ---- Detal: filiallar siyahı kimi */
    .top-table tr.detail table.det-stores, .top-table tr.detail table.det-stores tbody { display: block; width: 100%; min-width: 0; border: 0; background: none; }
    .top-table tr.detail table.det-stores tr:first-child { display: none; }
    .top-table tr.detail table.det-stores tr {
        display: grid; grid-template-columns: 1fr auto auto; gap: 2px 14px; align-items: baseline;
        padding: 9px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 6px;
    }
    .top-table tr.detail table.det-stores td { display: block; padding: 0; border: 0; text-align: left; }
    .top-table tr.detail table.det-stores td:nth-child(1) { font-weight: 600; color: var(--wool); }
    .top-table tr.detail table.det-stores td:nth-child(2)::after { content: " sat"; color: var(--muted); font-weight: 400; font-size: 12px; }
    .top-table tr.detail table.det-stores td:nth-child(3)::after { content: " qal"; color: var(--muted); font-size: 12px; }
    .top-table tr.detail table.det-stores td:nth-child(4) { grid-column: 1 / -1; padding-top: 4px; }
    .top-table tr.detail table.det-stores td:nth-child(4):has(.muted) { display: none; }
    .top-table tr.detail .det .table-scroll:has(.det-stores) { overflow: visible; }

    /* ---- Seçim pəncərəsi */
    html.sheet-open, html.sheet-open body { overflow: hidden; }
}
@media (max-width: 420px) {
    .grid.fields { grid-template-columns: 1fr; }
    .filter-grid, .top-grid, .sales-grid { grid-template-columns: 1fr !important; }
}

/* Ölçü cədvəllərində birinci sütun sürüşəndə yerində qalır */
.det-sizes tr > :first-child, .plan-table tr > :first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 var(--line-2); }
.det-sizes tr:first-child > :first-child { background: #F8F9FB; }
.plan-table tr.buy > :first-child { background: var(--wool); }

/* Seçim pəncərəsi (telefon) */
.sheet { position: fixed; inset: 0; z-index: 100; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(13, 20, 36, .45); opacity: 0; transition: opacity .2s; }
.sheet-panel {
    position: absolute; left: 0; right: 0; bottom: 0; max-height: min(78vh, 640px); display: flex; flex-direction: column;
    background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 40px rgba(13, 20, 36, .25);
    padding-bottom: env(safe-area-inset-bottom); transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
.sheet.in .sheet-backdrop { opacity: 1; }
.sheet.in .sheet-panel { transform: none; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: #D3D8E0; margin: 8px auto 2px; flex: 0 0 auto; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 8px 12px 10px 20px; border-bottom: 1px solid var(--line-2); }
.sheet-head b { flex: 1; font-size: 16px; color: var(--wool); }
.sheet-x { width: 40px; height: 40px; border: 0; background: var(--line-2); border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.sheet-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sheet-search { padding: 10px 16px 6px; }
.sheet-search[hidden] { display: none; }
.sheet-list { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 6px 8px 12px; }
.sheet-opt {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 12px 10px calc(12px + var(--d, 0) * 18px);
    border: 0; background: none; border-radius: 10px; font: inherit; font-size: 15px; color: var(--ink); text-align: left; cursor: pointer;
}
.sheet-opt[hidden] { display: none; }
.sheet-opt:active, .sheet-opt:hover { background: #F3F5F8; }
.sheet-opt .so-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sheet-opt[style*="--d:1"] .so-name::before, .sheet-opt[style*="--d:2"] .so-name::before, .sheet-opt[style*="--d:3"] .so-name::before {
    content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 8px 2px 0; border-left: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint);
}
.sheet-opt .so-count { font-size: 12px; color: var(--muted); background: var(--line-2); padding: 1px 8px; border-radius: 999px; }
.sheet-opt .so-tick { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: var(--brass); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.sheet-opt.on { background: #F4F6FA; font-weight: 650; color: var(--wool); }
.sheet-opt.on .so-tick { visibility: visible; }
@media (prefers-reduced-motion: reduce) { .sheet-panel, .sheet-backdrop { transition: none; } }

@media (max-width: 760px) {
    /* ---- Satış xülasəsi: kart, dəyərlər iki sütunda */
    .pair .body table.m-cards { min-width: 0; }
    table.store-sum > tbody > tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; cursor: pointer; }
    table.store-sum > tbody > tr > td.m-title { grid-column: 1 / -1; }
    table.store-sum > tbody > tr > td { padding: 2px 0; }

    /* ---- Nişanlı xanalar: etiket üstdə, nişanlar altda (kəsilməsin) */
    .top-table > tbody > tr > td:has(.chips-sm)::before { float: none; display: block; margin: 0 0 4px; }
    .top-table > tbody > tr > td:has(.chips-sm) { text-align: left; padding-top: 6px; }
    .top-table > tbody > tr > td .chips-sm { justify-content: flex-start; }

    /* ---- Detal: filial kartında xana fonları olmasın */
    .top-table tr.detail table.det-stores td { background: none !important; }

    /* ---- Köçürmə sətirləri kart kimi: ad + ölçü | say; altında göndərən/alan və səbəb */
    .pair .body table.lines { min-width: 0; }
    table.lines thead { display: none; }
    table.lines, table.lines tbody { display: block; width: 100%; }
    table.lines tr.fl {
        display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name qty" "meta qty" "snd snd" "rcv rcv" "why why";
        column-gap: 12px; row-gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--line-2);
    }
    table.lines tr.fl > td { display: block; border: 0; padding: 0; text-align: left; background: none !important; }
    table.lines tr.fl > td.l-n, table.lines tr.fl > td.l-code { display: none; }
    table.lines td.l-name { grid-area: name; font-weight: 600; color: var(--wool); font-size: 15px; }
    table.lines td.l-code, table.lines td.l-size { grid-area: meta; }
    table.lines td.l-size { justify-self: start; }
    table.lines td.l-qty { grid-area: qty; align-self: center; text-align: right; white-space: nowrap; }
    table.lines td.l-qty input.qty { width: 74px; height: 44px; font-size: 18px; }
    table.lines td.l-snd { grid-area: snd; margin-top: 6px; }
    table.lines td.l-rcv { grid-area: rcv; }
    table.lines td.l-snd, table.lines td.l-rcv { font-size: 13px; color: var(--ink); }
    table.lines td.l-snd::before, table.lines td.l-rcv::before { content: attr(data-label) " · "; color: var(--muted); }
    table.lines td.l-why { grid-area: why; margin-top: 4px; font-size: 12.5px; }
    .pair .body > .row.end { padding: 10px 16px 6px !important; justify-content: flex-start; }
    .pair .body > .row.end > .muted { flex: 1 1 auto !important; }
    .pair > summary form { width: 100%; }
    .pair > summary form .btn { width: 100%; }
}

/* Xəta səhifəsi */
.error-page { max-width: 520px; margin: 6vh auto; text-align: left; }
.error-code { font-size: 56px; font-weight: 800; letter-spacing: -.03em; color: var(--brass); line-height: 1; margin-bottom: 10px; }
body.guest .error-page { margin: 0 auto; }

/* Məhsul şəkli (detalda) */
.det.has-img { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 18px; align-items: start; }
.det-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.det-img { position: relative; width: 168px; aspect-ratio: 3 / 4; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; overflow: hidden; cursor: zoom-in; display: grid; place-items: center; box-shadow: 0 1px 2px rgba(22,33,58,.06); transition: box-shadow .15s, transform .15s; }
.det-img:not(.none):hover { box-shadow: 0 6px 18px rgba(22,33,58,.14); transform: translateY(-1px); }
.det-img img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .2s; }
.det-img.ok img { opacity: 1; }
.det-img:not(.ok):not(.none)::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(22,33,58,.06) 50%, transparent 70%) var(--chalk); background-size: 220% 100%; animation: shimmer 1.1s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }
.det-img-ph { display: none; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.det-img-ph svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.det-img.none { cursor: default; background: var(--chalk); border-style: dashed; }
.det-img.none img { display: none; }
.det-img.none .det-img-ph { display: flex; }
.det-img-zoom { position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(22,33,58,.78); display: none; place-items: center; }
.det-img.ok .det-img-zoom { display: grid; }
.det-img-zoom svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 760px) {
    .det.has-img { grid-template-columns: 1fr; gap: 12px; }
    .det-img { width: min(220px, 62vw); justify-self: center; }
    .det-img.none { width: 100%; aspect-ratio: auto; height: 64px; }
    .det-img.none .det-img-ph { flex-direction: row; }
    .det-img.none .det-img-ph svg { width: 22px; height: 22px; }
}

/* Tam ekran baxış */
html.noscroll, html.noscroll body { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(12,18,32,.92); display: flex; flex-direction: column; opacity: 0; transition: opacity .18s; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.lightbox.on { opacity: 1; }
.lb-bar { display: flex; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; color: #ECEFF3; }
.lb-title { flex: 1; min-width: 0; font-weight: 650; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(236,239,243,.22); background: rgba(236,239,243,.08); display: grid; place-items: center; cursor: pointer; flex: none; }
.lb-btn svg { width: 19px; height: 19px; fill: none; stroke: #ECEFF3; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-stage { flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; padding: 0 12px max(16px, env(safe-area-inset-bottom)); }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); object-fit: contain; border-radius: 6px; background: #fff; cursor: zoom-in; transform: scale(.97); transition: transform .2s; }
.lightbox.on .lb-stage img { transform: none; }
.lb-stage img.zoomed { max-width: none; max-height: none; cursor: zoom-out; }

.diag-img { margin-top: 12px; max-width: 220px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.btn.busy, button.busy { opacity: .7; cursor: progress; }
