:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --text: #1c2430;
  --muted: #6b7686;
  --line: #e2e7ee;
  --accent: #1f4e79;
  --accent-2: #2b6cb0;
  --accent-soft: #eaf1f8;
  --green: #1f8a4c;
  --green-soft: #e3f4ea;
  --amber: #a86400;
  --amber-soft: #fdf1dc;
  --red: #c0392b;
  --red-soft: #fbe7e5;
  --grey-soft: #eef0f3;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.hidden { display: none !important; }
a { color: var(--accent-2); }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; }
h2 { font-size: 20px; }
h3 { font-size: 15px; }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 18px; font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 24px;
  background: #fff; color: var(--text); border-bottom: 1px solid var(--line); padding: 0 20px; height: 54px;
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand img { display: block; }
.brand .logo-full { height: 37px; width: auto; }
.brand .logo-mark { display: none; }
.brand span { color: var(--muted); font-weight: 600; font-size: 14px; border-left: 1px solid var(--line); padding-left: 12px; white-space: nowrap; }
#nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
#nav a { color: #4a5563; text-decoration: none; padding: 8px 12px; border-radius: 6px; white-space: nowrap; }
#nav a:hover { background: var(--grey-soft); color: var(--text); }
#nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.user { display: flex; align-items: center; gap: 10px; font-size: 13px; opacity: .95; }

main { padding: 20px; max-width: 1500px; margin: 0 auto; }

/* Cards & layout */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; }

/* Forms */
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
input, select, textarea {
  font: inherit; color: var(--text); background: #fff;
  border: 1px solid #cfd7e2; border-radius: 6px; padding: 7px 9px; min-width: 0;
}
textarea { resize: vertical; min-height: 70px; }
label > input, label > select, label > textarea { width: 100%; }
label > input[type=checkbox] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b9d3ee; border-color: var(--accent-2); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }

.btn {
  font: inherit; font-weight: 500; cursor: pointer; border-radius: 6px;
  padding: 7px 14px; border: 1px solid #cfd7e2; background: #fff; color: var(--text);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: #f3f6fa; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #193f63; }
.btn.danger { color: var(--red); border-color: #f0c4bf; }
.btn.ghost { background: transparent; color: var(--text); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: none; background: none; cursor: pointer; color: var(--muted); padding: 4px 6px; border-radius: 4px; font-size: 14px; }
.icon-btn:hover { background: var(--grey-soft); color: var(--text); }

/* Tables */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f7f9fc; font-size: 12px; color: var(--muted); font-weight: 600; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafcff; }
tr.clickable { cursor: pointer; }
td.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; white-space: nowrap; }
td .sub { color: var(--muted); font-size: 12px; }
tr.inactive td { opacity: .55; }
.tall { max-height: calc(100vh - 230px); }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.b-green { background: var(--green-soft); color: var(--green); }
.b-amber { background: var(--amber-soft); color: var(--amber); }
.b-red { background: var(--red-soft); color: var(--red); }
.b-grey { background: var(--grey-soft); color: var(--muted); }
.b-blue { background: var(--accent-soft); color: var(--accent); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); }

/* Quote editor */
.picker { position: relative; }
.picker-results {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 15;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(20,40,70,.15); max-height: 420px; overflow: auto;
}
.pick { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick:hover, .pick.sel { background: var(--accent-soft); }
.pick .c { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; font-weight: 600; }
.pick .d { font-size: 12px; color: var(--muted); grid-column: 1; }
.pick .p { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.pick-cat { padding: 6px 12px; font-size: 11px; font-weight: 700; color: var(--accent); background: #f7f9fc; text-transform: uppercase; letter-spacing: .3px; }
.warn { color: var(--amber); font-size: 11.5px; margin-top: 3px; }
.div-ok { color: var(--green); }
.div-warn { color: var(--amber); }

/* Upload */
.drop {
  border: 2px dashed #c3cfdd; border-radius: var(--radius); padding: 26px; text-align: center;
  background: #fafcfe; cursor: pointer; transition: .15s;
}
.drop:hover, .drop.over { border-color: var(--accent-2); background: var(--accent-soft); }
.drop input { display: none; }
.result { margin-top: 12px; font-size: 13px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; display: grid; gap: 12px; padding: 28px; }
.login-logo { display: block; width: 190px; height: auto; margin: 0 auto 8px; }
.login-card h1 { color: var(--text); margin: 0; font-size: 20px; text-align: center; }
.login-card > p { margin: 0; text-align: center; }
.login-card .btn { justify-content: center; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1c2430; color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0;
  transition: .2s; pointer-events: none; z-index: 100; font-size: 13px; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }

.logo-prev { max-height: 60px; max-width: 200px; border: 1px solid var(--line); border-radius: 6px; padding: 4px; background: #fff; }

@media (max-width: 760px) {
  main { padding: 12px 16px; }
  .topbar { height: auto; flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  #nav { order: 3; width: 100%; flex: none; }
  .brand { flex: 1; }
  .brand .logo-full { display: none; }
  .brand .logo-mark { display: block; }
  .brand span { border: 0; padding: 0; color: var(--text); font-size: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------- Fiyat listesi ---------- */
.pl-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.pl-head h2 { margin: 0 0 2px; font-size: 22px; }
.pl-head .muted { font-size: 13px; }
.pl { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.pl-side { position: sticky; top: 70px; padding: 10px; max-height: calc(100vh - 90px); overflow: auto; }
.pl-group { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.pl-cat {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%;
  background: none; border: 0; border-radius: 6px; padding: 7px 10px; font: inherit; font-size: 13px;
  color: var(--text); text-align: left; cursor: pointer; line-height: 1.3;
}
.pl-cat:hover { background: var(--grey-soft); }
.pl-cat.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pl-cat span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pl-main { min-width: 0; }
.pl-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search span { position: absolute; left: 12px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 18px; pointer-events: none; }
.search input { width: 100%; padding: 11px 14px 11px 36px; font-size: 15px; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(20,40,70,.04); }
.seg { display: inline-flex; background: #e9edf3; border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: #fff; color: var(--accent); font-weight: 600; box-shadow: 0 1px 3px rgba(20,40,70,.12); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid #cfd7e2; background: #fff;
  border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text);
}
.chip b { color: var(--accent); }
.chip-edit { color: var(--accent-2); font-size: 12px; border-left: 1px solid var(--line); padding-left: 8px; }
.chip:hover { border-color: var(--accent-2); }

.pl-block { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.pl-block-head {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 16px;
  background: #f7f9fc; border-bottom: 1px solid var(--line); font-weight: 700; color: var(--accent); font-size: 13.5px;
}
.pl-block-head .muted { font-weight: 400; font-size: 12px; }
.pl-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 110px 150px 150px 28px; gap: 14px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s;
}
.pl-row:last-child { border-bottom: 0; }
.pl-row:hover, .pl-row:focus { background: #f6f9fd; outline: none; }
.pl-row.off { opacity: .55; }
.pl-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: 13.5px; letter-spacing: .2px; }
.pl-desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pl-model .badge { margin-top: 5px; margin-right: 4px; }
.pl-cap { display: flex; flex-direction: column; gap: 2px; }
.pl-cap .kw { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.pl-cap .kw small, .pl-price small { font-weight: 500; color: var(--muted); font-size: 11px; }
.pl-cap .kind { font-size: 11.5px; color: var(--muted); }
.pl-price { text-align: right; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.pl-price .noprice { font-size: 12.5px; font-weight: 500; color: var(--amber); }
.pl-act { text-align: right; }
.edit-ico { color: #b5bfcc; font-size: 15px; }
.pl-row:hover .edit-ico { color: var(--accent-2); }
.empty { text-align: center; padding: 36px 16px; }
.only-mobile { display: none; }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(16, 28, 45, .45); z-index: 50;
  display: grid; place-items: center; padding: 16px; animation: fade .12s ease-out;
}
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(10,25,50,.3); max-height: calc(100vh - 32px); overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }
.modal input.big { font-size: 18px; font-weight: 600; padding: 10px 12px; font-variant-numeric: tabular-nums; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.switch { flex-direction: row !important; align-items: center; gap: 8px; font-size: 13.5px !important; color: var(--text) !important; }
.stock-box { margin-top: 14px; padding: 10px 12px; background: #f7f9fc; border-radius: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 900px) {
  .pl { grid-template-columns: minmax(0, 1fr); }
  .pl-side { display: none; }
  .only-mobile { display: block; }
  .pl-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .pl-cap { grid-column: 1; flex-direction: row; gap: 8px; align-items: baseline; }
  .pl-stock { grid-column: 1; }
  .pl-price { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
  .pl-act { display: none; }
}

.pl-cat.empty { display: none; }

/* ---------- Teklif düzenleyici ---------- */
.qe-bar {
  display: flex; align-items: center; gap: 10px; position: sticky; top: 54px; z-index: 18;
  margin: -20px -20px 18px; padding: 12px 20px; background: rgba(244,246,249,.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
}
.qe-back { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; text-decoration: none; font-size: 18px; color: var(--muted); }
.qe-back:hover { background: #e6ebf2; color: var(--text); }
.qe-title { min-width: 0; }
.qe-no { font-weight: 700; font-size: 17px; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qe-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.qe-status { border-radius: 999px; padding: 5px 10px; font-size: 12.5px; font-weight: 600; border-color: transparent; background: var(--grey-soft); color: var(--muted); cursor: pointer; }
.qe-status[data-v=gonderildi] { background: var(--accent-soft); color: var(--accent); }
.qe-status[data-v=kazanildi] { background: var(--green-soft); color: var(--green); }
.qe-status[data-v=kaybedildi] { background: var(--red-soft); color: var(--red); }
.qe-save { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.qe-save[data-s=ok] { color: var(--green); }
.qe-save[data-s=err] { color: var(--red); font-weight: 600; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 34px rgba(20,40,70,.18); padding: 6px; z-index: 30; }
.menu-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; font: inherit; padding: 8px 10px; border-radius: 7px; cursor: pointer; color: var(--text); }
.menu-pop button:hover { background: var(--grey-soft); }
.menu-pop b { display: block; font-weight: 600; font-size: 13.5px; }
.menu-pop span { font-size: 12px; color: var(--muted); }
.menu-pop .only-phone { display: none; }
.menu-pop .danger b { color: var(--red); }

.qe-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.qe-main, .qe-side { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.qe-side { position: sticky; top: 134px; max-height: calc(100vh - 150px); overflow: auto; }
.qe-card { padding: 18px; border-radius: 12px; }
.qe-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.qe-card-head h3 { margin: 0; font-size: 16px; }
.qe-count { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.qe-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.qe-fields .w2 { grid-column: span 2; }
.qe-fields .w4 { grid-column: 1 / -1; }
.qe-more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.qe-more summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--accent-2); }
.qe-more[open] summary { margin-bottom: 12px; }
.qe-more summary span { font-weight: 400; margin-left: 6px; }
.qe-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.seg.full { display: flex; }
.seg.full button { flex: 1; }
.qe-rate { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; align-items: end; margin-top: 12px; }
.qe-rate .hint { grid-column: 1 / -1; }
.linkish { border: 0; background: none; padding: 2px 0; font: inherit; font-size: 12px; color: var(--accent-2); cursor: pointer; text-align: left; }
.linkish:hover { text-decoration: underline; }
.qe-toggle { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; color: var(--text); }
.qe-toggle b { display: block; font-size: 15px; }
.qe-toggle small { font-size: 12px; color: var(--muted); font-weight: 400; }
.qe-toggle input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; width: 42px; height: 24px; border-radius: 999px; border: 0; background: #c6cfda; position: relative; cursor: pointer; transition: background .15s; padding: 0; }
.qe-toggle input[type=checkbox]::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.qe-toggle input[type=checkbox]:checked { background: var(--green); }
.qe-toggle input[type=checkbox]:checked::after { left: 21px; }
.qe-toggle input[type=checkbox]:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
#montajFields .hint { margin-top: 8px; }

/* Toplam kartı */
.qe-total { padding: 18px; border-radius: 12px; }
.qt-label { font-size: 13px; color: var(--muted); }
.qt-label span { font-size: 12px; }
.qt-grand { font-size: 28px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.2; margin: 2px 0 12px; overflow-wrap: anywhere; }
.qt-lines { margin: 0; border-top: 1px solid var(--line); padding-top: 8px; }
.qt-lines > div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.qt-lines dt { color: var(--muted); }
.qt-lines dt small { display: block; font-size: 11.5px; }
.qt-lines dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.qt-alert { background: var(--amber-soft); color: var(--amber); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; margin-top: 10px; }
.qt-div { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.qt-div-top { display: flex; justify-content: space-between; font-size: 13px; }
.qt-bar { position: relative; height: 8px; border-radius: 999px; background: #e9edf3; margin: 7px 0 6px; }
.qt-bar .zone { position: absolute; left: 31.25%; width: 50%; top: 0; bottom: 0; background: #bfe3cd; border-radius: 999px; }
.qt-bar .mark { position: absolute; top: -3px; width: 4px; height: 14px; margin-left: -2px; border-radius: 3px; background: var(--green); }
.qt-bar .mark.bad { background: var(--amber); }
.qt-div-sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Ürün kalemleri */
.qe .picker { margin-bottom: 14px; }
.qe .pick .d { grid-column: 1; }
.qe .pick .s { text-align: right; }
.qe .pick-cat { text-transform: none; letter-spacing: 0; font-size: 12px; position: sticky; top: 0; z-index: 1; }
.pick-more { padding: 12px; text-align: center; font-size: 12.5px; color: var(--muted); }
.qe-empty { display: grid; gap: 4px; text-align: center; padding: 34px 16px; border: 1px dashed #c9d3df; border-radius: 10px; color: var(--muted); }
.qe-empty b { color: var(--text); }
.qi-cols, .qi { display: grid; grid-template-columns: minmax(0, 1fr) 118px 130px 124px 84px; gap: 12px; align-items: start; }
.qi-cols { padding: 0 14px 6px; font-size: 12px; color: var(--muted); }
.qi-cols span:nth-child(2) { text-align: center; }
.qi-cols span:nth-child(3), .qi-cols span:nth-child(4) { text-align: right; }
.qg { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.qg-head { background: #f7f9fc; border-bottom: 1px solid var(--line); padding: 8px 14px; font-weight: 600; font-size: 13px; color: var(--accent); }
.qg-head span { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.qi { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.qi:last-child { border-bottom: 0; }
.qi-code { font-weight: 700; font-size: 13.5px; }
.qi[data-i] .qi-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.qi-kw { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-weight: 600; font-size: 12px; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 7px; margin-left: 8px; white-space: nowrap; }
.qi-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.qi-tags { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; margin-top: 6px; }
.qi-over { font-size: 12px; color: var(--amber); }
.qi-over:empty { display: none; }
.qi-note, .qi-name, .qi-descin { width: 100%; }
.qi-note { margin-top: 6px; font-size: 12.5px; padding: 5px 8px; }
.qi-name { font-weight: 600; }
.qi-descin { margin-top: 6px; font-size: 12.5px; }
.qi-qty { display: flex; border: 1px solid #cfd7e2; border-radius: 8px; overflow: hidden; background: #fff; height: 36px; }
.qi-qty button { border: 0; background: #f3f6fa; width: 34px; flex: none; font-size: 17px; cursor: pointer; color: var(--accent); }
.qi-qty button:hover { background: var(--accent-soft); }
.qi-qty input { border: 0; border-radius: 0; width: 100%; text-align: center; padding: 0 2px; font-weight: 600; appearance: textfield; -moz-appearance: textfield; }
.qi-qty input::-webkit-inner-spin-button, .qi-price input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qi-qty:focus-within { border-color: var(--accent-2); }
.qi-qty input:focus { outline: none; }
.qi-price input { width: 100%; text-align: right; height: 36px; font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield; }
.qi-price.need input { border-color: var(--amber); background: var(--amber-soft); }
.qi-price.manual input { border-color: var(--accent-2); font-weight: 600; }
.qi-pnote { text-align: right; }
.qi-sum { text-align: right; font-weight: 700; padding-top: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qi-act { display: flex; justify-content: flex-end; padding-top: 4px; }
.qi.auto { background: #fbfcfe; }
.qi-qty.ro { border: 0; background: none; justify-content: center; align-items: center; font-weight: 600; }
.qi-price.ro { text-align: right; padding-top: 8px; font-variant-numeric: tabular-nums; }
.qe-foot { margin-top: 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.qe-foot .switch { margin-left: auto; font-size: 12.5px !important; color: var(--muted) !important; }
.qe-mobilebar { display: none; }

@media (max-width: 1180px) {
  .qe-grid { grid-template-columns: minmax(0, 1fr); }
  .qe-side { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 820px) {
  .qe-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qi-cols { display: none; }
  .qi { grid-template-columns: 118px minmax(0, 150px) minmax(0, 1fr); gap: 10px; }
  .qi-main { grid-column: 1 / -1; }
  .qi-sum { grid-column: 3; }
  .qi-act { grid-column: 1 / -1; }
  .qi.auto .qi-act { display: none; }
}
@media (max-width: 760px) {
  .qe { padding-bottom: 76px; }
  .qe-bar { position: relative; top: 0; z-index: 18; margin: -12px -16px 14px; padding: 10px 16px; flex-wrap: wrap; }
  .qe-title { flex: 1 1 calc(100% - 60px); }
  .qe-bar .spacer { display: none; }
  .qe-sub { max-width: 75vw; }
  #pdfPrice { display: none; }
  .menu { position: static; margin-left: auto; }
  .menu-pop { left: 16px; right: 16px; width: auto; top: calc(100% - 4px); }
  #pdfNoPrice { display: none; }
  .menu-pop .only-phone { display: block; }
  .qi { grid-template-columns: 118px minmax(0, 1fr); }
  .qi-sum { grid-column: 2; padding-top: 4px; }
  .qi-act { grid-column: 1; grid-row: 3; justify-content: flex-start; padding: 0; }
  .qi.auto .qi-sum { grid-column: 2; }
  .qi.auto .qi-qty.ro { justify-content: flex-start; }
  .qe-card { padding: 14px; }
  .qe-mobilebar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: #fff; border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(20,40,70,.08);
  }
  .qe-mobilebar small { display: block; font-size: 11.5px; color: var(--muted); }
  .qe-mobilebar b { font-size: 18px; color: var(--accent); font-variant-numeric: tabular-nums; }
}

/* ---------- Montaj detayı ---------- */
.modal.wide { max-width: 760px; }
.mj-btn { width: 100%; justify-content: center; margin-top: 10px; }
.mj-info { margin-top: 8px; }
.mj-table { max-height: 55vh; }
.mj-table td, .mj-table th { padding: 5px 10px; vertical-align: middle; }
.mj-table input { width: 92px; text-align: right; padding: 4px 8px; }
.mj-table .mj-g td { background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12.5px; }
@media (max-width: 760px) {
  .modal.wide .modal-foot { flex-wrap: wrap; }
  #mjTotal { width: 100%; }
  .mj-table td, .mj-table th { padding: 5px 6px; }
  .mj-table td:nth-child(4), .mj-table th:nth-child(4) { display: none; }
  .mj-table input { width: 72px; }
}
