:root {
  --bg: #f5f6f8; --card: #fff; --text: #1d2330; --muted: #6b7385; --line: #e3e6ec;
  --primary: #2453d6; --primary-weak: #e8eefc; --green: #16884a; --green-weak: #e4f5ec;
  --red: #c8352b; --red-weak: #fbe9e7; --amber: #b7791f; --amber-weak: #fdf3e1;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }

.topbar { display: flex; align-items: center; gap: 32px; padding: 0 24px; height: 56px; background: #141b2d; }
.brand { color: #fff; font-weight: 700; font-size: 16px; }
.brand span { color: #7ea2ff; }
.brand img { height: 24px; display: block; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { color: #b8c0d4; padding: 8px 12px; border-radius: 6px; }
.topbar #userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; color: #b8c0d4; }
.topbar #userbox button { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.login { max-width: 380px; margin: 60px auto; padding: 28px; }
.login h1 { margin-bottom: 6px; }
.login .notice { display: block; }
.notice.err { background: var(--red-weak); color: var(--red); display: block; }
.notice.ok { background: var(--green-weak); color: var(--green); display: block; }
.topbar nav a.active, .topbar nav a:hover { color: #fff; background: rgba(255,255,255,.08); }

main { max-width: 1280px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.kpi .value { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pos { color: var(--green); } .neg { color: var(--red); } .warn { color: var(--amber); }
.topbar nav a { white-space: nowrap; }

/* ---------- Grafik (Ana sayfa) ---------- */
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i, .chart-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.axis-label { fill: var(--muted); font-size: 11px; }
.hit { cursor: pointer; }
.hit:hover { fill: rgba(36, 83, 214, .05); }
.chart-tip { position: absolute; top: 0; width: 200px; background: #141b2d; color: #fff; font-size: 12px; padding: 8px 10px; border-radius: 8px; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.chart-tip div { margin-top: 3px; }
details summary { cursor: pointer; color: var(--muted); margin-top: 8px; }

/* ---------- Proje iş takvimi (haftalık şema) ---------- */
.gantt { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.gantt col.g-title { width: 260px; }
.gantt th, .gantt td { border: 1px solid var(--line); padding: 0; text-align: center; vertical-align: middle; }
.gantt th { font-weight: 600; color: var(--muted); padding: 3px 0; background: #fafbfc; }
.gantt .wd { display: block; font-weight: 400; font-size: 10px; color: var(--muted); }
.gantt .g-title { text-align: left; padding: 5px 8px; white-space: normal; }
.gantt .g-no { color: var(--muted); margin-right: 2px; }
.gantt .g-st { display: inline-block; margin-left: 6px; font-size: 10px; padding: 0 6px; border-radius: 99px; background: #eef0f4; color: #4b5366; white-space: nowrap; }
.gantt .g { height: 26px; min-width: 22px; }
.gantt .now { background: rgba(36, 83, 214, .06); }
.gantt .g-bar { display: block; height: 12px; margin: 0 1px; border-radius: 3px; }
.gantt .mk { font-size: 11px; color: var(--text); }
.gantt .g-marks td { height: 20px; }
.st-planlandi.g-bar, .g-legend i.st-planlandi { background: #b6bdca; }
.st-devam.g-bar, .g-legend i.st-devam { background: #2a78d6; }
.st-tamamlandi.g-bar, .g-legend i.st-tamamlandi { background: #16884a; }
.st-gecikti.g-bar, .g-legend i.st-gecikti { background: #c8352b; }
.g-st.st-devam { background: #e3eefb; color: #1c5cab; }
.g-st.st-tamamlandi { background: var(--green-weak); color: var(--green); }
.g-st.st-gecikti { background: var(--red-weak); color: var(--red); }
.g-legend { margin-top: 10px; flex-wrap: wrap; }

/* Yatay A4 sayfa (iş takvimi PDF'i) */
.page.landscape { width: 297mm; height: 210mm; }
.page.landscape .wm { left: 60mm; top: 20mm; width: 180mm; opacity: .10; }
.offer .doc-title { text-align: center; font-weight: 700; font-size: 16pt; text-decoration: underline; margin: 1mm 0 4mm; }
.offer .gantt { font-size: 8.5pt; }
.offer .gantt col.g-title { width: 62mm; }
.offer .gantt th, .offer .gantt td { border: .5pt solid #888; color: #000; }
.offer .gantt th { background: #f2f3f5; }
.offer .gantt .g { height: 6.5mm; min-width: 0; }
.offer .gantt .now { background: none; }
.offer .gantt .g-bar { height: 3.2mm; }
.offer .g-legend { font-size: 8.5pt; color: #333; margin-top: 2mm; }
.offer .g-list td, .offer .g-list th { font-size: 9.5pt; }
@page land { size: A4 landscape; margin: 0; }


button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 7px 14px; border-radius: 7px; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .btn:hover { border-color: #c3c9d6; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #1c46bb; }
.btn-danger { color: var(--red); }
.btn-sm { padding: 4px 9px; font-size: 13px; }
.icon-btn { border: none; background: none; padding: 4px 6px; color: var(--muted); }
.icon-btn:hover { color: var(--red); }

input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: #fff; color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-weak); border-color: var(--primary); }
textarea { resize: vertical; min-height: 70px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.span2 { grid-column: span 2; } .span-all { grid-column: 1 / -1; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr.clickable { cursor: pointer; } tbody tr.clickable:hover { background: #fafbfd; }
tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
/* Kalem tablosu: her kalem iki satır (üstte alanlar, altta tam genişlikte özellikler) — yatay kaydırma yok */
.items-table { width: 100%; }
.items-table thead tr, .items-table tbody tr {
  display: grid; column-gap: 8px; align-items: center;
  grid-template-columns: 24px minmax(130px, 2fr) minmax(90px, 1.2fr) minmax(80px, 1fr) 64px 78px minmax(88px, 1fr) minmax(88px, 1fr) minmax(96px, 1fr) 56px 128px;
}
.items-table th, .items-table td { padding: 4px 0; border: none; }
.items-table tbody tr { border-top: 1px solid var(--line); padding: 10px 8px; row-gap: 6px; }
/* Kalemler karışmasın: bir beyaz, bir gri */
.items-table tbody tr:nth-child(even) { background: #eceff3; }
.items-table .move-btn { font-size: 12px; padding: 4px 5px; }
.items-table .move-btn:hover:not(:disabled) { color: var(--text); }
.items-table .move-btn:disabled { opacity: .25; cursor: default; }
.items-table .c-desc { grid-row: 2; grid-column: 2 / -1; }
.items-table .c-desc textarea { min-height: 0; }
.items-table td.empty { grid-column: 1 / -1; }
.items-table .c-act { text-align: right; }
.items-table input, .items-table textarea { padding: 5px 7px; }
.items-table input.num { text-align: right; }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; color: var(--muted); padding: 30px; }

/* Teklif türü etiketi */
.type-tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.ty-proje { background: #e8f0fb; color: #1f5fae; border-color: #c9dbf3; }
.ty-bakim { background: #e9f6ee; color: #1f7a45; border-color: #c6e7d2; }
.ty-servis { background: #fdf1e7; color: #a4520f; border-color: #f4d6bb; }
h1 .type-tag { font-size: 13px; vertical-align: middle; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-taslak { background: #eef0f4; color: #4b5366; }
.st-gonderildi { background: var(--primary-weak); color: var(--primary); }
.st-onaylandi { background: var(--green-weak); color: var(--green); }
.st-reddedildi { background: var(--red-weak); color: var(--red); }
.st-tamamlandi { background: #ece6fb; color: #5b3cc4; }
/* Lead durumları */
.ld-yeni { background: var(--primary-weak); color: var(--primary); }
.ld-gorusuluyor { background: #e6f4f6; color: #127083; }
.ld-teklif_hazirlanacak { background: var(--amber-weak); color: #8a5a00; }
.ld-teklif { background: var(--green-weak); color: var(--green); }
.ld-kaybedildi { background: var(--red-weak); color: var(--red); }
.ld-beklemede { background: #eef0f4; color: #4b5366; }
.lead-pipe { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.lead-pipe button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 120px; padding: 8px 12px; }
.lead-pipe button b { font-size: 18px; }
.lead-pipe button.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 10px 16px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }

.notice { background: var(--amber-weak); color: #7a5112; border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.bar { height: 8px; background: #eef0f4; border-radius: 99px; position: relative; overflow: hidden; min-width: 120px; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.bar .est { background: #b6c6f2; } .bar .act { background: var(--primary); height: 4px; top: 2px; }
.bar .act.over { background: var(--red); }

.modal-bg { position: fixed; inset: 0; background: rgba(15,20,35,.45); display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; padding: 22px; width: 100%; max-width: 640px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #141b2d; color: #fff; padding: 9px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; }
#toast.show { opacity: 1; }
#busy { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 5px 14px; border-radius: 99px; font-size: 13px; z-index: 60; opacity: 0; transition: opacity .15s; pointer-events: none; }
#busy.show { opacity: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- Görsel yönetimi ---------- */
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { position: relative; width: 120px; height: 100px; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fafbfc; }
.thumb img { max-width: 100%; max-height: 100%; }
.thumb-actions { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; }
.thumb-actions button { padding: 1px 6px; font-size: 12px; background: rgba(255,255,255,.92); }
.thumb.add { cursor: pointer; color: var(--primary); border-style: dashed; font-size: 13px; margin: 0; }

/* ---------- Teklif (PDF) — Woirtech formatı ---------- */
.offer { --ink: #000; font-variant-ligatures: none; font-feature-settings: "liga" 0, "clig" 0; font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; font-size: 11pt; line-height: 1.2; color: var(--ink); }
.page { position: relative; width: 210mm; height: 297mm; margin: 0 auto 18px; background: #fff; overflow: hidden; box-shadow: 0 2px 14px rgba(0,0,0,.12); }
.page .wm { position: absolute; left: 12mm; top: 67mm; width: 188mm; opacity: .16; z-index: 0; pointer-events: none; }
.page .ph { position: absolute; top: 6mm; left: 12.7mm; right: 12.7mm; height: 13mm; border-bottom: .75pt solid #000; }
.page .ph img { position: absolute; right: 0; bottom: 1.6mm; height: 9.5mm; }
.page .ph .ph-name { position: absolute; right: 0; bottom: 1.6mm; font-size: 16pt; font-weight: 700; color: #000; }
.radio-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; margin: 0; color: var(--text); font-size: 14px; }
.radio-card input { width: auto; }
.radio-card span { display: flex; flex-direction: column; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-weak); }
.page .pc { position: absolute; top: 22mm; bottom: 21mm; left: 12.7mm; right: 12.7mm; overflow: hidden; z-index: 1; }
.page .pf { position: absolute; bottom: 7mm; left: 12.7mm; right: 12.7mm; border-top: .75pt solid #000; padding-top: 3.5mm; text-align: right; font-size: 11pt; color: #323E4F; }
.page .pf .sayfa { color: #8496B0; letter-spacing: .22em; }
.page .pf b { font-weight: 400; }

.offer .ln { min-height: 1.2em; }
.offer .ln.gap { height: .7em; min-height: 0; }
.offer .ln.dash { display: grid; grid-template-columns: 9mm 1fr; padding-left: 4mm; }
.offer .ln.dash > span { padding-left: 1mm; }
.offer .grid-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.offer .grid-table th, .offer .grid-table td { border: .75pt solid #000; padding: .4mm 1.6mm; vertical-align: middle; text-align: left; font-size: 11pt; line-height: 1.2; color: #000; white-space: normal; }
.offer .grid-table th { font-weight: 700; background: none; }
.offer .grid-table .c { text-align: center; } .offer .grid-table .r { text-align: right; }

.offer .cover .info { margin-top: 1mm; }
.offer .cust-logo { height: 80mm; display: flex; align-items: center; justify-content: center; margin-top: 8mm; }
.offer .cust-logo img { max-width: 115mm; max-height: 62mm; }
.offer .dear { margin: 10mm 0 0 15mm; }
.offer .intro { margin-top: 6mm; }
.offer .toc-title { margin-top: 32mm; text-align: center; font-weight: 700; text-decoration: underline; font-size: 16pt; }
.offer .toc { margin: 9mm 0 0; padding-left: 0; list-style: none; counter-reset: toc; }
.offer .toc li { counter-increment: toc; padding-left: 6mm; }
.offer .toc li::before { content: counter(toc) "- "; display: inline-block; width: 6mm; }

.offer h3.sec { font-size: 14pt; font-weight: 700; margin: 4mm 0 4mm 7mm; }
.offer h3.sec span { margin-right: 1.5mm; }
.offer .prod-title { text-align: center; font-weight: 700; font-size: 11.5pt; margin: 3mm 0 3mm; }
.offer .prod-img { text-align: center; margin-bottom: 4mm; }
.offer .prod-img img { max-width: 100%; max-height: 110mm; }
.offer .price { margin-bottom: 1mm; }
.offer .price thead th { padding-top: .6mm; padding-bottom: .6mm; }
.offer .price .ln.dash { grid-template-columns: 8mm 1fr; padding-left: 3mm; }
.offer .price tr.total td { font-weight: 700; text-align: center; }
.offer .company { margin-top: 5mm; }

@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff; }
  .no-print, .topbar { display: none !important; }
  main { padding: 0; max-width: none; }
  .offer { zoom: 1 !important; }
  .page { margin: 0; box-shadow: none; break-after: page; height: 296.6mm; } /* yuvarlama kaynaklı boş sayfaları önler */
  .page.landscape { page: land; height: 209.6mm; }
  .page:last-child { break-after: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* ---------- Tablet ve telefon ---------- */
.kpi .value.multi { font-size: 18px; }
@media (max-width: 1100px) {
  .topbar { gap: 16px; padding: 0 16px; }
  .topbar nav { overflow-x: auto; }
  .topbar #userbox span { display: none; }
  main { padding: 18px; }
  /* Kalem tablosu kartlara dönüşür */
  .items-table { min-width: 0; }
  .items-table thead { display: none; }
  .items-table tbody tr { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 12px; padding: 14px 10px; border-top: none; border-bottom: 1px solid var(--line); }
  .items-table tbody tr:last-child { border-bottom: none; }
  .items-table td { border: none; padding: 0; }
  .items-table .c-desc { grid-row: auto; }
  .items-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; text-align: left; }
  .items-table .c-no { display: none; }
  .items-table .c-name, .items-table .c-model, .items-table .c-brand { grid-column: span 2; }
  .items-table .c-desc { grid-column: span 6; }
  .items-table .c-qty, .items-table .c-unit { grid-column: span 1; }
  .items-table .c-price, .items-table .c-cost { grid-column: span 2; }
  .items-table .c-total, .items-table .c-margin { grid-column: span 2; text-align: left; align-self: center; }
  .items-table .c-act { grid-column: span 2; text-align: right; align-self: end; }
  .items-table td.empty { grid-column: span 6; }
  .page-head .actions { width: 100%; }
}
@media (max-width: 600px) {
  .items-table tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .items-table .c-name, .items-table .c-desc, .items-table td.empty { grid-column: span 2; }
  .items-table .c-model, .items-table .c-brand, .items-table .c-qty, .items-table .c-unit,
  .items-table .c-price, .items-table .c-cost, .items-table .c-total, .items-table .c-margin { grid-column: span 1; }
  .items-table .c-act { grid-column: span 2; }
  .page-head .actions > * { flex: 1 1 auto; width: auto !important; }
  .tabs { overflow-x: auto; }
  .tabs a { white-space: nowrap; padding: 10px 12px; }
}
/* Dokunmatik ekran: büyük dokunma alanları; iOS'ta odaklanınca yakınlaşmayı önlemek için 16px */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px; }
  button, .btn { padding: 9px 14px; }
  .btn-sm { padding: 7px 11px; }
  .icon-btn { padding: 8px 10px; }
  .tabs a { padding: 12px 16px; }
}
@media (max-width: 760px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .topbar { gap: 12px; padding: 0 12px; } main { padding: 16px; }
}

/* Firebase sürümü: giriş ekranı, çıkış bağlantısı */
.login-card { max-width: 380px; margin: 80px auto; text-align: center; padding: 32px 24px; }
.login-card .login-logo { width: 88px; height: 88px; border-radius: 18px; }
.login-card h1 { margin: 12px 0 4px; }
.login-card button { margin-top: 12px; }
.topbar #userbox .link-btn { padding: 4px 10px; font-size: 13px; }
@media (max-width: 760px) { .topbar #userbox span { display: none; } }

/* Telefon / dar ekran: sekmeler üç çizgili menüde */
.menu-btn { display: none; }
@media (max-width: 900px) {
  .topbar { position: sticky; top: 0; z-index: 50; }
  .topbar #userbox { margin-left: auto; }
  .menu-btn { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; width: 42px; height: 40px; padding: 0; background: transparent; border-color: rgba(255,255,255,.25); }
  .menu-btn span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
  .nav-open .menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-open .menu-btn span:nth-child(2) { opacity: 0; }
  .nav-open .menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .topbar nav { display: none; position: absolute; top: 56px; left: 0; right: 0; flex-direction: column; gap: 2px; padding: 8px 12px 14px;
    background: #141b2d; box-shadow: 0 10px 24px rgba(0,0,0,.25); overflow: visible; }
  .nav-open .topbar nav { display: flex; }
  .topbar nav a { padding: 13px 14px; font-size: 16px; border-radius: 8px; }
  #busy { top: 64px; }
}
@media print { .menu-btn { display: none !important; } }

/* ---------- Ürün kataloğu: kategori kutuları + kart görünümü ---------- */
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.cat-tile { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden; text-align: left; border-radius: 10px; background: #fff; }
.cat-tile .cat-img { display: block; height: 72px; background: linear-gradient(135deg, #eef1f7, #e3e8f2); }
.cat-tile .cat-img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.cat-tile .cat-name { padding: 8px 10px 9px; font-weight: 600; font-size: 13px; line-height: 1.25; padding-right: 34px; }
.cat-tile .cat-count { position: absolute; right: 8px; bottom: 8px; font-size: 12px; color: var(--muted); }
.cat-tile.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.cat-tile.on .cat-name { color: var(--primary); }
.cat-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.cat-filters input#q, .cat-filters #pk-q { flex: 1 1 220px; }
.cat-filters select { width: auto; }
.chk { display: inline-flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; font-size: 14px; }
.chk input { width: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-left: auto; }
.seg button { border: 0; border-radius: 0; background: #fff; }
.seg button.on { background: var(--primary); color: #fff; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.pgrid.small-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); max-height: 62vh; overflow-y: auto; padding: 2px; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; }
.pcard:hover, .pcard:focus { box-shadow: 0 6px 18px rgba(20, 27, 45, .12); transform: translateY(-2px); outline: none; }
.pcard.off { opacity: .55; }
.pimg { position: relative; aspect-ratio: 4 / 3; background: #f4f5f7; display: flex; align-items: center; justify-content: center; }
.pimg img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.pimg .noimg { font-size: 30px; font-weight: 700; color: #c3c9d6; letter-spacing: .05em; }
.pack-badge, .off-badge { position: absolute; top: 8px; left: 8px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.off-badge { left: auto; right: 8px; background: #6b7385; }
.pbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.pcat { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.pname { font-weight: 700; line-height: 1.3; }
.pprice { margin-top: auto; padding-top: 6px; font-weight: 600; color: var(--primary); }
.pcard.compact .pbody { padding: 8px 10px 10px; }
.pcard.compact .pname { font-size: 14px; }
.modal.picker { max-width: 980px; }
.comp-table { width: 100%; }
.comp-table td { padding: 3px 4px 3px 0; border: 0; }
@media (max-width: 600px) {
  .cat-tiles { grid-template-columns: repeat(2, 1fr); }
  .pgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .seg { margin-left: 0; }
}
.pimg img:not([src]), .cat-img img:not([src]) { visibility: hidden; }
