/* ============================================================
   DemCloud: interfeys
   ============================================================ */
:root {
  --bg: #f3f4f6; --surface: #fff; --surface-2: #f8f9fb; --ink: #141c2b; --ink-2: #3b4558; --muted: #6b7486;
  --line: #e3e6eb; --line-2: #d3d8e0;
  --brand: #18304f; --brand-2: #234570; --brand-soft: #e8eef7;
  --accent: #d9862b; --accent-soft: #fdf1e2;
  --ok: #127a57; --ok-soft: #e3f4ec; --warn: #a85c09; --warn-soft: #fdf0dd; --danger: #b8322a; --danger-soft: #fbe8e6;
  --info: #2a62b8; --info-soft: #e6eefb; --violet: #6a45a8; --violet-soft: #efe9f8;
  --r: 10px; --r-sm: 7px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --side: 232px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- Kabuk ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--side); background: var(--brand); color: #cfd9e8; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 750; font-size: 17px; letter-spacing: -.01em; }
.side .brand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.side .tenant { padding: 0 18px 14px; font-size: 12px; color: #93a5bf; border-bottom: 1px solid rgba(255,255,255,.08); }
.side nav { padding: 10px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px; color: #cfd9e8; font-weight: 500; }
.side nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.side nav a.on { background: rgba(255,255,255,.12); color: #fff; }
.side nav a svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.side nav .sep { height: 1px; background: rgba(255,255,255,.08); margin: 8px 4px; }
.side .me { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12.5px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side .me a { color: #93a5bf; }
.main { flex: 1; margin-left: var(--side); min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(243,244,246,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 10px 24px; }
.topbar .burger { display: none; }
.topbar form.search { flex: 1; max-width: 420px; }
.content { padding: 22px 24px 96px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { margin-top: 4px; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Kartlar ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-b { padding: 16px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.stack > * + * { margin-top: 16px; }

.kpi { padding: 16px; }
.kpi .v { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 12.5px; font-weight: 500; }

/* ---------- Düymələr ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(.95); background: var(--accent); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(0,0,0,.05); }
.btn-danger { color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 34px; height: 34px; padding: 0; }

/* ---------- Formalar ---------- */
[hidden] { display: none !important; }
label.f { display: block; }
label.f > span, .f-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=password],
input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff;
  font: 14px var(--font); color: var(--ink); outline: none; transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(35,69,112,.14); }
.form { display: grid; gap: 14px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-civ { grid-template-columns: 140px 1fr 1fr; }
@media (max-width: 560px) { .row-civ { grid-template-columns: 1fr; } }
/* Ünvan bloku: 6 sütun, boş xana qalmır */
.stop-grid { display: grid; gap: 12px; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; }
.stop-grid > * { grid-column: span 2; }
.stop-grid > .s3 { grid-column: span 3; }
.stop-grid > .s4 { grid-column: span 4; }
.compose-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.compose-top > .seg { flex: none; }
.compose-top > label { flex: 1 1 220px; }
.dist-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 14px; }
.dist-row > label { width: 220px; }
.dist-row > .hint { flex: 1 1 260px; }
@media (max-width: 560px) { .stop-grid > *, .stop-grid > .s3 { grid-column: span 3; } .stop-grid > .s4, .stop-grid > :last-child { grid-column: 1 / -1; } .dist-row > label { width: 100%; } }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg label { cursor: pointer; }
.seg input { display: none; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 12px; border-radius: 5px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg span svg { width: 16px; height: 16px; flex: none; }
.seg input:checked + span { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Cədvəllər ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: #fafbfc; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* ---------- Nişanlar ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.b-lead { background: var(--info-soft); color: var(--info); }
.b-visite { background: var(--violet-soft); color: var(--violet); }
.b-devis, .b-sent { background: var(--warn-soft); color: var(--warn); }
.b-accepte, .b-signed, .b-paid { background: var(--ok-soft); color: var(--ok); }
.b-planifie { background: var(--brand-soft); color: var(--brand-2); }
.b-realise, .b-issued { background: #e7f0ef; color: #1d6b66; }
.b-facture { background: #eef2e4; color: #55701b; }
.b-clos, .b-draft { background: #eef0f3; color: #5a6475; }
.b-perdu, .b-refused, .b-retracted, .b-cancelled, .b-expired { background: var(--danger-soft); color: var(--danger); }

/* ---------- Bildirişlər ---------- */
.flash { padding: 11px 14px; border-radius: var(--r-sm); margin-bottom: 16px; font-weight: 500; border: 1px solid; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: #b8e2cf; }
.flash.err { background: var(--danger-soft); color: var(--danger); border-color: #f2c5c1; }
.flash.warn { background: var(--warn-soft); color: var(--warn); border-color: #f5d7ab; }
.notice { padding: 12px 14px; border-radius: var(--r-sm); background: var(--accent-soft); border: 1px solid #f3d3a8; color: #6e4210; font-size: 13px; }
.notice.info { background: var(--info-soft); border-color: #c8d9f5; color: #1d4b8f; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 8px; }

/* ---------- Tablar ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--brand); border-color: var(--accent); }
.tabs a .n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--surface-2); font-size: 11.5px; color: var(--muted); text-align: center; }

/* ---------- Açar-dəyər ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Ünvan kartları ---------- */
.stops { display: grid; gap: 12px; }
.stop { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: #fff; position: relative; }
.stop .tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.stop.loading .tag { color: var(--accent); }
.stop.delivery .tag { color: var(--ok); }
.route-line { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.route-line .arrow { color: var(--muted); }

/* ---------- Pipeline ---------- */
.pipe { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pipe a { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: 13px; }
.pipe a:hover { text-decoration: none; border-color: var(--line-2); }
.pipe a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.pipe a .n { font-weight: 700; opacity: .7; }

/* ---------- Status addımları ---------- */
.steps { display: flex; gap: 0; overflow-x: auto; margin-bottom: 18px; }
.steps .st { flex: 1; min-width: 100px; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 4px 0; border-top: 3px solid var(--line); }
.steps .st.done { color: var(--ok); border-color: var(--ok); }
.steps .st.cur { color: var(--brand); border-color: var(--accent); }

/* ---------- Təqvim ---------- */
.cal { display: grid; grid-template-columns: 56px repeat(7, minmax(110px, 1fr)); border-top: 1px solid var(--line); min-width: 860px; }
.cal .hd { position: sticky; top: 0; background: var(--surface-2); padding: 8px; text-align: center; font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal .hd.today { color: var(--accent); }
.cal .hr { font-size: 11px; color: var(--muted); text-align: right; padding: 2px 6px 0 0; height: 48px; border-bottom: 1px solid var(--line); }
.cal .day { position: relative; border-left: 1px solid var(--line); }
.cal .slot { height: 48px; border-bottom: 1px solid var(--line); }
.cal .slot:hover { background: #fafbfc; cursor: pointer; }
.ev { position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 3px 6px; font-size: 11.5px; line-height: 1.3; overflow: hidden; color: #fff; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.ev b { display: block; font-weight: 650; }
.ev.done { opacity: .5; text-decoration: line-through; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(16,24,40,.45); display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 100; overflow-y: auto; }
.modal.open { display: flex; }
.modal .box { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 40px rgba(16,24,40,.25); }
.modal .box .card-h { border-radius: 14px 14px 0 0; }

/* ---------- Smeta redaktoru ---------- */
.lines td { padding: 6px 8px; }
.lines input { height: 34px; }
.lines { min-width: 760px; } .lines td:first-child { min-width: 280px; } .lines .c-qty { width: 70px; } .lines .c-unit { width: 84px; } .lines .c-pu { width: 108px; } .lines .c-vat { width: 64px; } .lines .c-tot { width: 110px; } .lines .c-x { width: 40px; }
.totals { margin-left: auto; width: 300px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-variant-numeric: tabular-nums; }
.totals .big { font-size: 18px; font-weight: 750; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth .art { background: var(--brand); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth .art h1 { font-size: 32px; max-width: 420px; line-height: 1.15; }
.auth .art p { color: #b9c7da; max-width: 420px; font-size: 15px; }
.auth .art .boxes { position: absolute; right: -40px; bottom: -30px; opacity: .14; }
.auth .panel { display: grid; place-items: center; padding: 32px; }
.auth form { width: 100%; max-width: 360px; }

/* ---------- Mobil ---------- */
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .main { margin-left: 0; }
  .topbar { padding: 10px 14px; }
  .topbar .burger { display: inline-flex; }
  .content { padding: 16px 14px 100px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; } .auth .art { display: none; }
  .kv { grid-template-columns: 110px 1fr; }
  .table.resp thead { display: none; }
  .table.resp tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table.resp td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 14px; }
  .table.resp td::before { content: attr(data-l); color: var(--muted); font-size: 12px; }
  .totals { width: 100%; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr 1fr; } h1 { font-size: 19px; } }
.steps { scrollbar-width: none; } .steps::-webkit-scrollbar { display: none; }

/* ---------- İnventar (planşet üçün) ---------- */
.inv { display: grid; grid-template-columns: 220px minmax(0,1fr) 360px; gap: 0; height: calc(100vh - 57px); background: var(--surface); border-top: 1px solid var(--line); }
.inv-rooms { border-right: 1px solid var(--line); overflow-y: auto; padding: 10px; background: var(--surface-2); }
.inv-rooms button { display: flex; width: 100%; justify-content: space-between; align-items: center; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 8px; font: 600 13.5px var(--font); color: var(--ink-2); cursor: pointer; }
.inv-rooms button:hover { background: #fff; }
.inv-rooms button.on { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.inv-rooms button .v { font-weight: 600; font-size: 12px; color: var(--muted); }
.inv-cat { overflow-y: auto; padding: 14px; }
.inv-cat .tools { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.cat-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: #fff; transition: border-color .12s, background .12s; }
.cat-item.has { border-color: var(--ok); background: #f3fbf7; }
.cat-item .nm { font-weight: 600; font-size: 13.5px; line-height: 1.25; min-height: 34px; }
.cat-item .meta { font-size: 12px; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 0; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; width: max-content; }
.stepper button { width: 40px; height: 36px; border: 0; background: var(--surface-2); font: 700 18px var(--font); color: var(--brand); cursor: pointer; }
.stepper button:active { background: var(--brand-soft); }
.stepper span { min-width: 38px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.inv-side { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.inv-side .tot { padding: 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.inv-side .tot .v { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.inv-side .tot .l { font-size: 12px; color: var(--muted); }
.inv-lines { flex: 1; overflow-y: auto; }
.inv-line { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.inv-line .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.inv-line .flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.flag { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 3px 9px; font: 600 11.5px var(--font); color: var(--ink-2); cursor: pointer; }
.flag.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.flag.dump.on { background: var(--danger); border-color: var(--danger); }
.flag.leave.on { background: #6b7486; border-color: #6b7486; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.sync.pending .dot { background: var(--warn); } .sync.off .dot { background: var(--danger); }
.sig-pad { width: 100%; height: 180px; border: 2px dashed var(--line-2); border-radius: 10px; background: #fff; touch-action: none; }
@media (max-width: 1100px) { .inv { grid-template-columns: 170px minmax(0,1fr); } .inv-side { position: fixed; right: 0; top: 0; bottom: 0; width: min(380px, 92vw); background: #fff; z-index: 80; transform: translateX(100%); transition: transform .2s; box-shadow: -10px 0 30px rgba(0,0,0,.15); } body.show-list .inv-side { transform: none; } }
@media (max-width: 640px) { .inv { grid-template-columns: 1fr; height: auto; } .inv-rooms { display: flex; overflow-x: auto; gap: 4px; border-right: 0; border-bottom: 1px solid var(--line); } .inv-rooms button { white-space: nowrap; width: auto; } .cat-grid { grid-template-columns: 1fr 1fr; } }
.topbar form.search { min-width: 0; }
.inv-title { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 560px) {
  .topbar .btn-accent span, .topbar .lbl { display: none; }
  .topbar .btn-accent { width: 38px; padding: 0; }
  .topbar { gap: 8px; }
  .sync span:last-child { display: none; }
  .inv-title .small { display: none; }
}

/* ---------- Planning (icra planı) ---------- */
.plan-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }
.plan-tray { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; position: sticky; top: 74px; max-height: calc(100vh - 96px); overflow-y: auto; box-shadow: var(--shadow); }
.tray-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tray-item { border: 1px solid var(--line-2); border-left: 4px solid var(--accent); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: #fff; cursor: grab; user-select: none; -webkit-user-select: none; }
.tray-item.wk { background: var(--accent-soft); }
.tray-item.focus { outline: 2px solid var(--accent); }
.tray-item b { display: block; font-size: 13px; }
.plan-board { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.pg { display: grid; min-width: 1200px; }
.pg-hd { position: sticky; top: 0; z-index: 2; background: var(--surface-2); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 8px; font-size: 12.5px; }
.pg-hd b { display: block; }
.pg-hd span { color: var(--muted); font-size: 11.5px; }
.pg-hd span.full { color: var(--danger); font-weight: 700; }
.pg-hd.today { background: var(--accent-soft); }
.pg-hd.today b { color: #8a4f10; }
.pg-hd.corner { border-left: 0; }
.pg-veh { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border-bottom: 1px solid var(--line); font-size: 13px; background: #fff; position: sticky; left: 0; z-index: 1; }
.pg-veh .sw { width: 10px; height: 10px; border-radius: 3px; margin-top: 4px; flex: none; }
.pg-veh.none { background: var(--surface-2); }
.pg-cell { min-height: 92px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px; display: flex; flex-direction: column; gap: 5px; transition: background .1s; }
.pg-cell.we { background: #fafbfc; }
.pg-cell.off { background: repeating-linear-gradient(135deg, #f6f7f9 0 8px, #eceff3 8px 16px); }
.pg-cell .off-l { font-size: 11px; font-weight: 600; color: var(--muted); }
.pg-cell.over { background: var(--brand-soft); outline: 2px dashed var(--brand-2); outline-offset: -3px; }
.job { background: #fff; border: 1px solid var(--line-2); border-left: 4px solid var(--brand-2); border-radius: 7px; padding: 5px 7px; font-size: 11.5px; line-height: 1.3; cursor: pointer; user-select: none; -webkit-user-select: none; box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.job[data-drag] { cursor: grab; }
.job:hover { border-color: var(--brand-2); }
.job.over { outline: 2px solid var(--accent); }
.job .jt { display: flex; justify-content: space-between; gap: 4px; color: var(--muted); font-weight: 600; }
.job .jt .kd { text-transform: uppercase; font-size: 9.5px; letter-spacing: .04em; }
.job .jn { display: block; font-size: 12.5px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .jr, .job .jm { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .jm { color: var(--muted); }
.job .av { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 4px; }
.job .av span { width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 9px; font-weight: 700; display: grid; place-items: center; }
.job .av span.lead { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--accent); }
.job .av span.none { width: auto; height: auto; color: var(--danger); background: none !important; font-size: 10.5px; font-weight: 600; }
.job .js { margin-top: 3px; font-weight: 700; color: var(--ok); font-size: 10.5px; }
.job .jw { margin-top: 4px; display: flex; gap: 3px; align-items: center; color: var(--danger); font-weight: 600; font-size: 10.5px; }
.job .jw svg { width: 11px; height: 11px; flex: none; }
.job.warn { border-color: #f0c9c5; }
.job.k-chargement { border-left-color: var(--accent); }
.job.k-livraison { border-left-color: var(--ok); }
.job.k-emballage, .job.k-cartons { border-left-color: var(--violet); }
.job.k-autre { border-left-color: #9aa3b2; }
.job.st-done { opacity: .7; background: var(--ok-soft); }
.job.dragging, .tray-item.dragging, .chip.dragging { opacity: .35; }
.ghost { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; opacity: .92; box-shadow: 0 12px 30px rgba(16,24,40,.28); transform-origin: 0 0; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
.crew-cell { flex-direction: row; flex-wrap: wrap; align-content: flex-start; gap: 4px; background: var(--surface-2); }
.pg-veh.crew-h { background: var(--surface-2); }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 8px 2px 2px; font-size: 11px; font-weight: 600; background: #fff; color: var(--ink-2); user-select: none; -webkit-user-select: none; }
.chip[data-drag] { cursor: grab; }
.chip i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; background: var(--c); color: #fff; font-size: 8.5px; display: grid; place-items: center; }
.chip.busy { background: color-mix(in srgb, var(--c) 14%, #fff); border-color: color-mix(in srgb, var(--c) 45%, #fff); }
.chip.abs { opacity: .45; text-decoration: line-through; }
.picks { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.pick { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.pick > span { flex: 1; min-width: 0; }
.pick b { display: block; font-size: 13px; }
.pick small { color: var(--muted); }
.pick em { color: var(--warn); font-style: normal; font-weight: 600; }
.pick.abs { background: var(--surface-2); }
.pick input[type=radio] { accent-color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 9px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; z-index: 300; max-width: 92vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }
@media (max-width: 900px) { .plan-wrap { grid-template-columns: 1fr; } .plan-tray { position: static; max-height: none; display: flex; gap: 8px; overflow-x: auto; flex-wrap: nowrap; } .plan-tray .tray-h, .plan-tray .hint { display: none; } .tray-item { min-width: 220px; margin: 0; } }
.dmg { display: flex; gap: 10px; margin-top: 8px; align-items: flex-start; }
.dmg img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* ---------- Briqada tətbiqi ---------- */
.crew-main { max-width: 760px; margin: 0 auto; padding: 14px 14px 40px; display: flex; flex-direction: column; gap: 12px; }
.crew-main .card + .card { margin-top: 0; }
.crew-status .big { width: 100%; justify-content: center; margin-top: 14px; min-height: 54px; font-size: 16px; }
.csteps { display: flex; gap: 6px; margin-top: 12px; }
.csteps > div { flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.csteps span { display: block; height: 6px; border-radius: 3px; background: var(--line); margin-bottom: 6px; }
.csteps .on { color: var(--ok); }
.csteps .on span { background: var(--ok); }
details.room { border-bottom: 1px solid var(--line); }
details.room summary { display: flex; justify-content: space-between; padding: 11px 16px; cursor: pointer; list-style: none; }
details.room summary::-webkit-details-marker { display: none; }
details.room[open] summary { background: var(--surface-2); }
.iline { padding: 7px 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; font-size: 13.5px; }
.iline.not { opacity: .6; }
.iline .flags i { font-style: normal; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; background: var(--brand-soft); color: var(--brand-2); margin-left: 4px; }
.iline .flags i.h { background: var(--danger-soft); color: var(--danger); }
.crew-day { margin: 18px 0 8px; font-size: 15px; }
a.mission { display: block; color: inherit; text-decoration: none; border-left: 4px solid var(--brand-2); }
a.mission:hover { border-color: var(--accent); }
a.mission.st-done { opacity: .6; border-left-color: var(--ok); }
.mission .mt { display: flex; justify-content: space-between; align-items: center; }
.mission .time { font-weight: 750; font-size: 15px; font-variant-numeric: tabular-nums; }
.mission .mn { font-size: 16px; font-weight: 700; margin: 4px 0 2px; }

/* ---------- Statistika ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filters .seg { flex-wrap: wrap; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: #eceef2; stroke-width: 1; }
.chart .axis { stroke: #d3d8e0; stroke-width: 1; }
.chart .tick { font: 11px var(--font); fill: var(--muted); }
.chart .val { font: 600 11px var(--font); fill: var(--ink-2); }
.chart .mark { fill: #2a78d6; }
.chart .hit { fill: transparent; }
.chart .bar.on .hit { fill: rgba(42,120,214,.06); }
.ctip { position: absolute; pointer-events: none; opacity: 0; transition: opacity .1s; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; box-shadow: 0 6px 18px rgba(16,24,40,.12); white-space: nowrap; z-index: 5; }
.ctip span { color: var(--muted); }
.mbar { display: inline-block; width: 70px; height: 8px; background: #eef1f5; border-radius: 0 4px 4px 0; margin-right: 8px; vertical-align: 0; overflow: hidden; }
.mbar span { display: block; height: 100%; background: #2a78d6; border-radius: 0 4px 4px 0; }
.table.stat td, .table.stat th { white-space: nowrap; }
@media (max-width: 900px) { .mbar { display: none; } }
.grid > .card + .card, .split > .card + .card { margin-top: 0; }
@media (max-width: 640px) {
  .pg { grid-template-columns: 112px repeat(7, minmax(140px, 1fr)) !important; }
  .pg-veh { padding: 8px; font-size: 12px; }
  .pg-veh .small { display: none; }
}

/* ---------- Dil seçimi ---------- */
.side .langsel { display: flex; align-items: center; gap: 8px; padding: 0 18px 16px; color: #93a5bf; }
.side .langsel svg { width: 16px; height: 16px; flex: none; }
.side .langsel select { background: rgba(255,255,255,.07); color: #cfd9e8; border: 1px solid rgba(255,255,255,.12); padding: 5px 8px; font-size: 12.5px; height: auto; }
.side .langsel select option { color: var(--ink); }
.langs-pub { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; margin-top: 18px; font-size: 12.5px; }
.langs-pub a { color: var(--muted); }
.langs-pub a.on { color: var(--ink); font-weight: 700; }

/* ---------- Kontakt axtarışı (siyahı) ---------- */
.ac-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-sm); margin-top: 4px; max-height: 240px; overflow: auto; background: var(--surface); }
.ac-list:empty { display: none; }
.ac-item { text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 12px; font: inherit; color: inherit; cursor: pointer; }
.ac-item:hover { background: var(--surface-2); }
.ac-item:last-child { border-bottom: 0; }

/* ---------- Təqvim: gün və ay görünüşü ---------- */
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-month .dh { padding: 6px 8px; font-size: 12px; font-weight: 650; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-month .dc { min-height: 104px; padding: 4px 5px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-month .dc.out { background: var(--surface-2); color: var(--muted); }
.cal-month .dc.today .dn { background: var(--brand); color: #fff; border-radius: 999px; padding: 0 6px; }
.cal-month .dn { font-size: 12px; font-weight: 650; align-self: flex-start; color: var(--ink); }
.cal-month .dc.out .dn { color: var(--muted); }
.cal-month .dc.today .dn { color: #fff; }
.cal-month .ev { position: static; box-shadow: none; display: block; font-size: 11.5px; line-height: 1.3; padding: 2px 5px; border-radius: 5px; background: var(--brand-soft); color: var(--brand-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-left: 3px solid var(--c, var(--brand-2)); }
.cal-month .ev.done { opacity: .5; text-decoration: line-through; }
.cal-month a.ev:hover { text-decoration: none; filter: brightness(.97); }
.agenda-filters select { width: auto; min-width: 150px; }
.cal-month .ev.mv { background: var(--accent-soft); color: var(--warn); border-left-color: var(--accent); }
.cal-month .more { font-size: 11px; color: var(--muted); }
@media (max-width: 760px) { .cal-month .dc { min-height: 70px; } .cal-month .ev { font-size: 10.5px; } }

/* ---------- Çap ---------- */
@media print {
  .side, .topbar, .tabs .n, .actions, .btn, .burger, .langsel, .no-print, .modal { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .content { padding: 0 !important; max-width: none !important; }
  body { background: #fff; font-size: 11px; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
  .tabs a:not(.on) { display: none; }
  a { color: inherit; text-decoration: none; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ---------- Düzəliş və istək qeydləri (/remarques) ---------- */
.side nav a .nbadge { margin-left: auto; min-width: 20px; padding: 0 6px; height: 20px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 750; display: inline-grid; place-items: center; }
.fb-fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 70; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 11px 16px; background: var(--brand); color: #fff; font: 650 13.5px var(--font); box-shadow: 0 8px 22px rgba(16,24,40,.28); cursor: pointer; }
.fb-fab svg { width: 18px; height: 18px; }
.fb-fab:hover { background: var(--brand-2); }
body.nav-open .fb-fab, body.is-dragging .fb-fab { display: none; }
@media (max-width: 640px) { .fb-fab span { display: none; } .fb-fab { width: 50px; height: 50px; padding: 0; justify-content: center; } }
.fb-list { display: flex; flex-direction: column; gap: 10px; }
.fb-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; color: inherit; box-shadow: var(--shadow); }
.fb-row:hover { border-color: var(--brand-2); text-decoration: none; }
.fb-row.unread { border-left: 4px solid var(--accent); }
.fb-thumb { width: 56px; height: 56px; border-radius: 9px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.fb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fb-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fb-t { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-t .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-right: 7px; }
.fb-m { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.fb-cnt { display: inline-flex; gap: 8px; align-items: center; }
.fb-cnt svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 2px; }
@media (max-width: 700px) { .fb-row { grid-template-columns: 48px minmax(0, 1fr); } .fb-thumb { width: 48px; height: 48px; } .fb-side { grid-column: 1 / -1; justify-content: flex-start; } .fb-t { white-space: normal; } }
.fb-body { white-space: normal; line-height: 1.55; overflow-wrap: anywhere; }
.fb-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fb-img img { width: 150px; height: 108px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); display: block; cursor: zoom-in; }
@media (max-width: 560px) { .fb-img { flex: 1 1 44%; } .fb-img img { width: 100%; height: 120px; } }
.fb-msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-top: 10px; }
.fb-msg.sup { background: var(--brand-soft); border-color: #cfdcee; }
.fb-msg-h { margin-bottom: 4px; }
.fb-st { display: flex; align-items: center; gap: 5px; margin-top: 8px; color: var(--ink-2); }
.fb-st svg { width: 14px; height: 14px; color: var(--ok); }
.fb-az { margin-top: 12px; border-top: 1px dashed var(--line-2); padding-top: 8px; }
.fb-az summary { cursor: pointer; font-size: 12.5px; font-weight: 650; color: var(--violet); }
.fb-az textarea { margin-top: 8px; }
.fb-verify { border-left: 4px solid var(--ok); margin-bottom: 14px; }
.fb-verify .card-b { display: flex; gap: 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.fb-top { display: flex; gap: 12px; justify-content: space-between; align-items: end; flex-wrap: wrap; }
.fb-pri { max-width: 150px; }
#m-fb .box { max-height: 96vh; overflow-y: auto; }
.fb-drop { border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 10px; transition: .15s; }
.fb-drop.over { border-color: var(--brand-2); background: var(--brand-soft); }
.fb-drop-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fb-drop-row .btn svg { width: 16px; height: 16px; }
.fb-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-drop.has .fb-thumbs { margin-bottom: 10px; }
.fb-th { position: relative; width: 92px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); cursor: pointer; background: var(--surface-2); }
.fb-th img { width: 100%; height: 100%; object-fit: cover; }
.fb-th button { position: absolute; top: 4px; width: 24px; height: 24px; padding: 4px; border: 0; border-radius: 50%; background: rgba(20,28,43,.72); color: #fff; cursor: pointer; }
.fb-th button svg { width: 16px; height: 16px; display: block; }
.fb-th-ann { left: 4px; } .fb-th-rm { right: 4px; }
@media (hover: hover) and (pointer: fine) { .fb-cam { display: none; } }
.fb-ann { position: fixed; inset: 0; z-index: 400; background: rgba(15,20,32,.94); display: flex; flex-direction: column; }
.fb-ann-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 14px calc(10px); background: #fff; }
.fb-ann-col input { width: 38px; height: 34px; padding: 2px; border-radius: 8px; }
.fb-ann-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 14px; }
.fb-ann-stage canvas { max-width: 100%; max-height: 100%; background: #fff; border-radius: 6px; touch-action: none; cursor: crosshair; }
.fb-lightbox { position: fixed; inset: 0; z-index: 350; background: rgba(15,20,32,.92); display: grid; place-items: center; padding: 18px; }
.fb-lightbox[hidden] { display: none; }
.fb-lightbox img { max-width: 100%; max-height: 92vh; border-radius: 8px; }
.fb-lightbox button { position: absolute; top: 16px; right: 16px; background: #fff; }
.fb-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 24px); z-index: 500; display: flex; gap: 14px; align-items: center; max-width: 92vw; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; }
.fb-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.fb-toast a { color: #f2b36b; white-space: nowrap; }
@media (max-width: 560px) { .fb-toast { left: 12px; right: 12px; transform: translateY(24px); bottom: calc(84px + env(safe-area-inset-bottom)); } .fb-toast.show { transform: none; } }
@media (hover: none), (pointer: coarse) { .fb-drop-row .hint { display: none; } }

/* ---------- Qiymət qutusu: hesablanmış + son qiymət ---------- */
.price-box { border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface-2); padding: 12px 14px; }
.price-box.manual { border-color: var(--accent); background: var(--accent-soft); }
.pb-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 16px; align-items: start; }
.pb-l { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.pb-calc b { display: block; font-size: 17px; line-height: 38px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb-calc .small { display: block; margin-top: -6px; white-space: nowrap; }
.price-box.manual .pb-calc b { color: var(--muted); font-weight: 600; }
.pb-in { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pb-in > input[type=text] { flex: 1 1 140px; width: auto; }
.pb-in > input[type=text] { font-size: 17px; font-weight: 700; padding-right: 28px; text-align: right; min-width: 0; font-variant-numeric: tabular-nums; }
.pb-in > input[type=text]::placeholder { color: #a9b2c0; font-weight: 600; }
.pb-in > i { font-style: normal; color: var(--muted); font-weight: 600; margin: 0 4px 0 -28px; width: 16px; pointer-events: none; }
.pb-in .seg { flex: none; }
.pb-in .seg span { padding: 6px 9px; font-size: 12.5px; }
.pb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pb-chips button { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; height: 30px; padding: 0 11px; font: 600 12.5px var(--font); color: var(--ink-2); cursor: pointer; }
.pb-chips button:hover { border-color: var(--brand-2); color: var(--brand); }
.price-box:not(.manual) [data-pb-reset] { display: none; }
.pb-diff { margin-top: 9px; font-size: 12.5px; color: var(--ink-2); min-height: 18px; }
.pb-diff:empty { display: none; }
.pb-diff .neg, .price-box .neg { color: var(--danger); }
.pb-diff .pos { color: var(--ok); }
.quote-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: start; }
.quote-foot .totals { margin-left: 0; width: 250px; }
tr.adj td { background: var(--accent-soft); }
tr.adj input { font-weight: 600; }
.calc-list { margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; }
.calc-list li { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.calc-list li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.offer { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.offer > div:first-child { flex: 1; min-width: 220px; }
@media (max-width: 900px) { .quote-foot { grid-template-columns: 1fr; } .quote-foot .totals { width: 100%; } }
@media (max-width: 520px) { .pb-top { grid-template-columns: 1fr; gap: 8px; } .pb-calc { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; } .pb-calc .pb-l { width: 100%; margin: 0; } .pb-calc b { line-height: 1.4; } .pb-calc .small { margin: 0; } .pb-chips button { height: 36px; padding: 0 13px; } }

/* Kontakt seçimi (sifarişçi / ödəyici) */
.picker-find { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.picker-q { position: relative; flex: 1 1 260px; }
.picker-q input { width: 100%; }
.picker-res { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow: auto; }
.picker-res a { display: block; padding: 9px 12px; border-bottom: 1px solid var(--line); color: inherit; }
.picker-res a:hover { background: var(--surface-2); }
.picker-sel { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 12px; background: var(--surface-2); }
.picker-sel > span { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.picker-sel svg { width: 16px; height: 16px; flex: none; }
.picker-new { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 12px; }
.picker-new-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
[data-parties] > .seg, [data-parties] .f > .seg { flex-wrap: wrap; }
.party-line { font-size: 13px; color: var(--muted); margin-top: 2px; }
.sep-title { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.badge.b-info { background: var(--info-soft); color: var(--info); }
.badge svg { width: 13px; height: 13px; flex: none; }
.row-addr { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.3fr); }
@media (max-width: 640px) { .row-addr { grid-template-columns: 1fr 1fr; } .row-addr > :first-child { grid-column: 1 / -1; } }
.fb-doc { display: inline-flex; align-items: center; gap: 8px; max-width: 260px; height: 46px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface-2); color: inherit; font-size: 13px; font-weight: 600; }
.fb-doc svg { width: 20px; height: 20px; flex: none; color: var(--danger); }
.fb-doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-th.doc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; background: var(--surface-2); font-size: 11px; text-align: center; overflow: hidden; }
.fb-th.doc > svg { width: 26px; height: 26px; color: var(--danger); }
.fb-th.doc span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-ref { margin-top: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--warn-soft); font-size: 14px; }
.vol-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.vol-form > div:first-of-type { flex: 1 1 260px; }
.vol-in { display: inline-flex; align-items: center; gap: 6px; }
.vol-in input { width: 110px; }
/* Mətn yanında fayl ikonu (brochure, CGV PDF) */
.ico-txt { display: inline-flex; align-items: center; gap: 6px; }
.ico-txt svg { width: 18px; height: 18px; flex: none; color: var(--danger); }
/* Dosye: dövrdən dəqiq tarixə keçid (qeyd #6) */
.when-fix { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.when-fix input[type=date] { width: auto; min-width: 150px; padding: 5px 8px; }
[data-when] > .seg { flex-wrap: wrap; }
/* Agenda: dəqiq tarixi hələ bilinməyən köçmələr (qırıq xətt) */
.when-strip { margin-bottom: 12px; }
.when-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.when-chip { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; border: 1px dashed var(--accent); background: #fff; color: var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; }
.when-chip:hover { background: var(--accent-soft); text-decoration: none; }
.cal .hd .when-day { display: block; margin-top: 4px; font-size: 11px; border: 1px dashed var(--accent); color: var(--warn); border-radius: 5px; padding: 1px 4px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-month .ev.pd { background: transparent; color: var(--warn); border: 1px dashed var(--accent); border-left: 3px solid var(--accent); }

/* ---------- Tablar: brauzerdəki kimi bir neçə səhifə açıq (qeyd #5) ---------- */
html.tabs-shell, html.tabs-shell body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.tabs-shell .shell { height: 100%; min-height: 0; }
.tabs-shell .main { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; }
.tabs-shell .topbar { position: relative; flex: none; background: var(--bg); backdrop-filter: none; border-bottom: 0; padding-bottom: 6px; }
.tabbar { flex: none; display: flex; align-items: flex-end; gap: 4px; padding: 0 12px; background: var(--bg); border-bottom: 1px solid var(--line-2); position: relative; z-index: 25; }
.tabbar-list { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-bottom: -1px; }
.tabbar-list::-webkit-scrollbar { display: none; }
.tab { position: relative; flex: 0 1 250px; min-width: 128px; display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 5px 0 12px; border: 1px solid transparent; border-bottom: 0; border-radius: 9px 9px 0 0; color: var(--muted); font-size: 13px; font-weight: 550; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; outline: none; }
.tab:hover { background: rgba(255,255,255,.6); color: var(--ink-2); }
.tab:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-soft); }
.tab.on { background: var(--surface); color: var(--ink); border-color: var(--line-2); z-index: 1; }
.tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--surface); }
.tab.on::before { content: ""; position: absolute; left: 10px; right: 10px; top: -1px; height: 2px; border-radius: 0 0 2px 2px; background: var(--accent); }
.tab-ic { width: 16px; height: 16px; flex: none; display: grid; place-items: center; }
.tab-ic svg { width: 16px; height: 16px; }
.tab.on .tab-ic { color: var(--brand-2); }
.tab.busy .tab-ic svg { display: none; }
.tab.busy .tab-ic::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--brand-2); animation: tabspin .7s linear infinite; }
@keyframes tabspin { to { transform: rotate(360deg); } }
.tab-t { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tab-dot { display: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.tab.dirty .tab-dot { display: block; }
.tab-x { flex: none; width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; padding: 0; opacity: .55; }
.tab-x svg { width: 14px; height: 14px; }
.tab-x:hover { background: rgba(16,24,40,.08); opacity: 1; }
.tab:not(.on):not(:hover) .tab-x { opacity: .35; }
.one-tab .tab-x { display: none; }
.tab.new { animation: tabflash 1s ease-out; }
@keyframes tabflash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }
.tabbar-btn { flex: none; width: 34px; height: 34px; margin-bottom: 3px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.tabbar-btn:hover { background: rgba(255,255,255,.75); color: var(--ink); }
.tabbar-btn svg { width: 18px; height: 18px; }
.tabbar-more { position: relative; flex: none; }
.tabmenu { position: absolute; right: 0; top: calc(100% + 2px); min-width: 240px; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 12px 30px rgba(16,24,40,.16); padding: 6px; z-index: 90; display: flex; flex-direction: column; }
.tabmenu[hidden] { display: none; }
.tabmenu button { text-align: left; border: 0; background: none; padding: 10px 11px; border-radius: 7px; font: 500 13.5px var(--font); color: var(--ink); cursor: pointer; }
.tabmenu button:hover { background: var(--bg); }
.tabmenu .sep { height: 1px; background: var(--line); margin: 4px 2px; }
.tabframes { position: relative; flex: 1; min-height: 0; background: var(--bg); }
/* iOS Safari iframe-i məzmunun eninə qədər genişləndirməsin: width 1px + min-width 100% */
.tabframes iframe { position: absolute; top: 0; left: 0; width: 1px; min-width: 100%; height: 100%; border: 0; display: block; visibility: hidden; background: var(--bg); }
.tabframes iframe.on { visibility: visible; z-index: 1; }
/* Tabın içindəki səhifə: menyu və axtarış qabıqdadır */
html.in-tab .shell > .side, html.in-tab .main > .topbar { display: none !important; }
html.in-tab .main { margin-left: 0; }
html.in-tab .shell { min-height: 0; display: block; }
html.in-tab .content { padding-top: 18px; }
@media (max-width: 900px) { .tabbar { padding: 0 8px; } .tab { flex-basis: 230px; min-width: 116px; } .tabs-shell .topbar { padding-bottom: 6px; } }
@media (max-width: 560px) { .tab { flex-basis: 150px; min-width: 104px; font-size: 12.5px; padding-left: 9px; } .tabbar-btn { width: 30px; } }
@media (hover: none) { .tab:not(.on) .tab-x { opacity: .45; } }
.tab { container-type: inline-size; }
@container (max-width: 150px) { .tab:not(.on) .tab-x { display: none; } }
@media print { .tabbar { display: none !important; } }

/* ---------- Sənəd redaktoru (Paramètres > Modèles de documents > Éditeur) ---------- */
.ed-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.ed-bar .f { margin: 0; min-width: 120px; flex: 0 1 auto; }
.ed-bar input[type=color] { width: 56px; height: 36px; padding: 2px; }
.ed-bar input[type=number] { width: 90px; }
.ed-wrap .tox-tinymce { border-radius: var(--r); border-color: var(--line-2); }
.ed-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.ed-ver { position: relative; }
.ed-ver summary { list-style: none; }
.ed-ver summary::-webkit-details-marker { display: none; }
.ed-ver-list { position: absolute; bottom: calc(100% + 6px); right: 0; min-width: 270px; max-height: 320px; overflow: auto; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 12px 30px rgba(16,24,40,.16); padding: 6px; z-index: 50; display: flex; flex-direction: column; }
.ed-ver-list a { padding: 8px 10px; border-radius: 7px; color: var(--ink); font-size: 13px; }
.ed-ver-list a:hover { background: var(--bg); text-decoration: none; }
@media (max-width: 640px) { .ed-bar .f { min-width: 0; flex: 1 1 40%; } }

/* ---------- Sənəd baxışı: telefon / planşet (qeyd #9) ---------- */
html.dv-open, html.dv-open body { overflow: hidden; }
.dv { position: fixed; inset: 0; z-index: 200; background: #525a66; display: flex; flex-direction: column; }
.dv-bar { flex: none; display: flex; align-items: center; gap: 6px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; background: var(--brand); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.dv-t { flex: 1; min-width: 0; font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-btn { flex: none; height: 40px; min-width: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; font: 600 18px/1 var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dv-btn svg { width: 20px; height: 20px; }
.dv-btn span { font-size: 13.5px; }
.dv-x { background: rgba(255,255,255,.2); }
.dv-btn:active { background: rgba(255,255,255,.3); }
.dv-body { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px 12px calc(16px + env(safe-area-inset-bottom)); text-align: center; }
.dv-page { display: block; margin: 0 auto 12px; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.35); }
.dv-img { max-width: 100%; height: auto; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.35); }
.dv-msg { color: #fff; padding: 40px 16px; font-size: 15px; }
@media (max-width: 480px) { .dv-btn span { display: none; } .dv-bar { gap: 4px; } }
.ed-foot .ed-dos { max-width: 240px; height: 34px; }

/* ---------- Domenin brendi: müştərinin loqosu (config brand_dir) ---------- */
.side .brand .logo.logo-img { width: auto; height: 50px; padding: 3px 8px; background: #fff; border-radius: 9px; }
.side .brand .logo-img img { height: 44px; width: auto; display: block; }
.auth-logo-card { display: inline-flex; align-items: center; background: #fff; border-radius: 12px; padding: 6px 10px; }
.auth-logo-card img { height: 46px; width: auto; display: block; }
.auth form .auth-logo { display: none; height: 84px; width: auto; margin: 0 0 4px; }
@media (max-width: 900px) { .auth form .auth-logo { display: block; } }   /* sol panel gizləndikdə loqo formanın üstündə */
