/* Грани памяти — тёмный полированный габбро + сусальное золото.
   Всё своё: шрифты и текстура камня в /static, никаких CDN — сайт должен открываться и при белых списках. */
:root {
  --granite: #141518;
  --slab: #1D1F23;          /* полированная плита — плитки, формы */
  --slab-2: #25282D;
  --edge: #383B41;          /* кромка плиты */
  --field: #0F1012;         /* поле ввода — «выборка» в камне */
  --ink: #ECE7DC;           /* светлый текст, как серебрёная надпись */
  --muted: #A3A7AE;
  --gold: #D9B65E;          /* сусальное золото */
  --gold-hi: #EED79A;
  --gold-lo: #9C7A2E;
  --gold-line: rgba(217, 182, 94, .32);
  --ok-bg: #1F2E22;  --ok-ink: #A9D69B;  --ok-edge: #3E6A3A;
  --err-bg: #34191A; --err-ink: #F2A9A3; --err-edge: #7A3330;
  --facet: 14px;            /* срез угла — «грань» */
  --serif: 'Forum', 'Times New Roman', serif;
  --sans: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --gilt: linear-gradient(160deg, #F2DEA6 0%, #D9B65E 38%, #B8923E 70%, #E3C576 100%);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { background: var(--granite) url(/static/granite.jpg) repeat; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 16px/1.5 var(--sans);
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255,255,255,.07), rgba(255,255,255,0) 55%) fixed,
    radial-gradient(ellipse at 50% 120%, rgba(0,0,0,.55), rgba(0,0,0,0) 60%) fixed;
}
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-hi); }
h1 {
  font: 400 38px/1.15 var(--serif); margin: 10px 0 4px; letter-spacing: .02em;
  color: var(--gold); text-shadow: 0 1px 0 rgba(0,0,0,.6);
}
h2 { font: 600 19px/1.3 var(--sans); margin: 32px 0 12px; color: var(--ink); }
p { margin: 6px 0; }
b { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- знак и название ---------- */
.mark { width: 30px; height: 30px; flex: none; display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-name { font: 400 24px/1 var(--serif); color: var(--gold); letter-spacing: .04em; }
.brand:hover .brand-name { color: var(--gold-hi); }

/* ---------- шапка: полоса чуть темнее, по низу золотая кромка ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap;
  padding: 13px 22px; background: rgba(8, 9, 10, .72);
  border-bottom: 1px solid var(--gold-lo); box-shadow: 0 1px 0 rgba(238,215,154,.12), 0 6px 18px rgba(0,0,0,.45);
}
.topnav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.topnav a, .linkbtn { color: var(--muted); text-decoration: none; font-size: 15px; }
.topnav a:hover, .linkbtn:hover { color: var(--gold-hi); }
.linkbtn { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 15px; }
.inline { display: inline; margin: 0; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 22px 20px 64px; }
.back { font-size: 15px; }
.back a { color: var(--muted); text-decoration: none; }
.back a:hover { color: var(--gold-hi); }
.lead { color: var(--muted); margin-bottom: 4px; }

/* ---------- полированная плита: формы, таблицы ---------- */
.card {
  background: linear-gradient(170deg, rgba(255,255,255,.05), rgba(255,255,255,0) 40%), var(--slab);
  border: 1px solid var(--edge); border-radius: 2px; padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 26px rgba(0,0,0,.45);
}
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.span2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-size: 16px; }
input, select {
  font: inherit; color: var(--ink); background: var(--field); border: 1px solid #4A4E55; border-radius: 2px;
  padding: 10px 12px; min-height: 46px; width: 100%;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.5);
}
input::placeholder { color: #6E727A; }
input[type=date] { color-scheme: dark; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; padding: 0; flex: none; accent-color: var(--gold); box-shadow: none; }
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: inset 0 2px 4px rgba(0,0,0,.5), 0 0 0 2px rgba(217,182,94,.35); }

/* ---------- кнопка: позолоченная табличка со срезанным углом ---------- */
.btn {
  font: 600 16px/1 var(--sans); color: #1A1B1E; background: var(--gilt); border: 0; cursor: pointer;
  padding: 15px 26px; min-height: 48px; border-radius: 0; letter-spacing: .01em;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { filter: brightness(.95); }
.btn:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

.flash { border-radius: 2px; padding: 11px 14px; margin: 8px 0 18px; border: 1px solid; }
.flash.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-edge); }
.flash.err { background: var(--err-bg); color: var(--err-ink); border-color: var(--err-edge); }

/* ---------- «грань»: срезанный угол с позолоченной фаской ---------- */
.facet {
  background:
    linear-gradient(225deg, var(--gold) 0 calc(var(--facet) - 1px), transparent var(--facet)) no-repeat,
    linear-gradient(170deg, rgba(255,255,255,.07), rgba(255,255,255,0) 45%),
    var(--slab);
  clip-path: polygon(0 0, calc(100% - var(--facet)) 0, 100% var(--facet), 100% 100%, 0 100%);
}

/* ---------- плитки разделов: чёрные полированные плиты ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 24px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 112px; padding: 22px 20px 20px;
  text-decoration: none; color: var(--ink);
  border-left: 1px solid var(--edge); border-bottom: 2px solid #0B0C0D;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
  transition: border-color .15s ease;
}
.tile:hover { border-left-color: var(--gold); }
.tile:hover .tile-t { color: var(--gold-hi); }
.tile-t { font: 400 25px/1.1 var(--serif); color: var(--gold); letter-spacing: .02em; transition: color .15s ease; }
.tile-d { color: var(--muted); font-size: 14px; line-height: 1.45; }

/* ---------- вход ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login { width: 100%; max-width: 390px; }
.login-head { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 28px; text-align: center; }
.login-head .mark { width: 72px; height: 72px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.7)); }
.login-title { font: 400 48px/1 var(--serif); color: var(--gold); letter-spacing: .05em; margin: 0; text-shadow: 0 2px 0 rgba(0,0,0,.7); }
.login-rule { width: 120px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); border: 0; margin: 2px 0; }
.login-sub { color: var(--muted); margin: 0; font-size: 15px; letter-spacing: .02em; }
.login .card { padding: 24px; border: 0; box-shadow: 0 18px 40px rgba(0,0,0,.6); }
.login .btn { width: 100%; margin-top: 4px; }

/* ---------- таблицы ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--gold-line); }
.tbl td { padding: 12px 8px; border-bottom: 1px solid #2E3136; vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.off td { color: #7C8088; }
.tag { font-size: 12px; background: #2E3136; color: var(--muted); border-radius: 2px; padding: 1px 6px; }
@media (max-width: 640px) {
  .tbl thead { display: none; }
  .tbl tr { display: block; padding: 10px 0; border-bottom: 1px solid #2E3136; }
  .tbl td { display: block; border: 0; padding: 2px 0; }
  .tbl td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 13px; }
  .tbl td:first-child::before { content: none; }
  h1 { font-size: 32px; }
  .login-title { font-size: 42px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- цены ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 22px 0 6px; border-bottom: 1px solid var(--gold-line); }
.tab {
  padding: 10px 16px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--gold-hi); }
.tab.on { color: var(--gold); border-bottom-color: var(--gold); }
.pgroup h2, h2.ph { font: 400 26px/1.2 var(--serif); color: var(--gold); letter-spacing: .02em; margin: 30px 0 10px; }
.card.flush { padding: 6px 16px 4px; }
.num { text-align: right; white-space: nowrap; }
.tbl th.num { text-align: right; }
.price { font-weight: 600; font-variant-numeric: tabular-nums; }
.manual { color: var(--muted); font-weight: 400; font-style: italic; }
.pname { font-weight: 600; }
.pnote { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.ptbl td { vertical-align: middle; }
.ptbl tr.editing td { background: rgba(217,182,94,.06); vertical-align: top; }
.acts { text-align: right; white-space: nowrap; }
.acts a { font-size: 15px; }
.ptbl tr.editing .acts { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.mt { margin-top: 8px; }
.w-unit { width: 76px; }
.w-num { width: 112px; text-align: right; }
.range { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.btn-sm { padding: 11px 18px; min-height: 42px; font-size: 15px; }
.link-quiet { color: var(--muted); }
.linkbtn.danger { color: #D99A92; font-size: 14px; }
.linkbtn.danger:hover { color: var(--err-ink); }
details.add { border-top: 1px solid #2E3136; margin: 4px -16px 0; padding: 0 16px; }
details.add summary { cursor: pointer; padding: 12px 0; color: var(--gold); font-size: 15px; }
details.add summary:hover { color: var(--gold-hi); }
.grid-add { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; padding: 4px 0 16px; align-items: end; }
.grid-add .span-name { grid-column: span 2; }
.history { margin-top: 36px; }
.history summary { cursor: pointer; color: var(--muted); }
.history summary:hover { color: var(--gold-hi); }
.loglist { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; }
.loglist li { padding: 7px 0; border-bottom: 1px solid #2E3136; }
@media (max-width: 760px) {
  .grid-add { grid-template-columns: 1fr 1fr; }
  .grid-add .span-name { grid-column: 1 / -1; }
  .ptbl td.num, .ptbl td.acts, .itbl td.num, .itbl td.acts, .otbl td.num { text-align: left; }
  .ptbl tr.editing .acts { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .range { justify-content: flex-start; }
  .w-num, .w-unit { width: 100%; text-align: left; }
  .ptbl tr.editing td { padding: 6px 0; }
  .ptbl tr.editing td[data-l]::before { display: block; margin-bottom: 4px; }
  .ptbl tr.editing td:first-child { padding-top: 12px; }
  .pgroup h2 { font-size: 23px; }
}

/* ---------- заказы ---------- */
textarea {
  font: inherit; color: var(--ink); background: var(--field); border: 1px solid #4A4E55; border-radius: 2px;
  padding: 10px 12px; width: 100%; resize: vertical; box-shadow: inset 0 2px 4px rgba(0,0,0,.5);
}
textarea:focus { outline: none; border-color: var(--gold); box-shadow: inset 0 2px 4px rgba(0,0,0,.5), 0 0 0 2px rgba(217,182,94,.35); }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
fieldset legend { font-size: 14px; color: var(--muted); margin-bottom: 6px; padding: 0; width: 100%; }
.headrow { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 20px; flex-wrap: wrap; }
.headrow .lead { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.cnt { font-weight: 400; color: #7C8088; font-size: 13px; margin-left: 2px; }
.tab-red, .tab-red .cnt { color: #F08A80; }
.search { display: flex; gap: 10px; align-items: center; margin: 16px 0; }
.search input { flex: 1; }
.otbl .orow { cursor: pointer; }
.otbl .orow:hover td { background: rgba(217,182,94,.05); }
.otbl .orow.redo td { background: rgba(176, 50, 44, .14); }
.ono { color: var(--muted); font-variant-numeric: tabular-nums; }
.oname { color: var(--ink); font-weight: 600; text-decoration: none; }
.oname:hover { color: var(--gold-hi); }
.bang {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%;
  background: #C0392B; color: #fff; font-weight: 700; font-size: 13px; line-height: 1;
}
.bang.big { width: 34px; height: 34px; font-size: 20px; flex: none; }
.chip { display: inline-block; font-size: 12.5px; padding: 2px 8px; border: 1px solid var(--edge); color: var(--muted); border-radius: 20px; white-space: nowrap; }
.chip-pick { border-color: rgba(217,182,94,.5); color: var(--gold); }
.chip-red { border-color: #C0392B; color: #F08A80; }
.chip-gold { border-color: rgba(217,182,94,.6); color: var(--gold-hi); }
.chip-blue { border-color: rgba(92,138,194,.7); color: #A9C6EA; }
.chip-green { border-color: rgba(98,160,90,.7); color: #A9D69B; }
.st { display: inline-block; font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 2px; white-space: nowrap; background: #2E3136; color: var(--ink); }
.st-carving { background: #2E3136; color: #C9CDD3; }
.st-ready { background: rgba(217,182,94,.18); color: var(--gold-hi); }
.st-assigned { background: rgba(92,138,194,.2); color: #A9C6EA; }
.st-installed { background: rgba(98,160,90,.2); color: #A9D69B; }
.st-closed, .st-issued { background: transparent; color: #8E939B; border: 1px solid var(--edge); }
.st-cancelled { background: transparent; color: #7C8088; text-decoration: line-through; }
.warn { color: #F0B36A; }
.owe { color: #F0B36A; }
.empty { text-align: center; padding: 34px 20px; }

.redo-box {
  display: flex; gap: 14px; align-items: flex-start; margin: 14px 0; padding: 14px 16px;
  background: rgba(176,50,44,.16); border: 1px solid #8E2F29; border-left: 4px solid #C0392B; color: #F6D0CC;
}
.stage { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.stage-steps { display: flex; flex-wrap: wrap; gap: 4px; }
.step { font-size: 13.5px; padding: 6px 12px; background: #24262B; color: #7C8088; position: relative; }
.step.done { color: var(--muted); background: #2A2D32; }
.step.done::before { content: "✓ "; color: var(--gold); }
.step.now { background: var(--gilt); color: #1A1B1E; font-weight: 600; }
.stage-acts { display: flex; flex-direction: column; gap: 12px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { min-width: 220px; }
.act-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.act-row:empty { display: none; }
.redo-form summary { cursor: pointer; color: #F08A80; display: inline-flex; gap: 8px; align-items: center; }
.redo-form form { margin-top: 10px; }
.btn-red { background: linear-gradient(160deg, #E0645A, #B0322C); color: #fff; text-shadow: none; }

.hint { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.chipbtn {
  font: 600 14px var(--sans); color: var(--gold); background: transparent; border: 1px dashed rgba(217,182,94,.55);
  padding: 7px 12px; cursor: pointer; border-radius: 2px;
}
.chipbtn:hover { background: rgba(217,182,94,.1); color: var(--gold-hi); }
.itbl td { vertical-align: middle; }
.itbl tfoot td { border-bottom: 0; padding-top: 14px; }
.tot-l { font-weight: 600; }
.tot { font: 400 26px/1 var(--serif); color: var(--gold); }
.ready {
  font: 600 13px var(--sans); padding: 6px 11px; cursor: pointer; border-radius: 20px; white-space: nowrap;
  background: transparent; color: var(--muted); border: 1px solid var(--edge);
}
.ready.on { background: rgba(98,160,90,.2); color: #A9D69B; border-color: #3E6A3A; }
.ready.on::before { content: "✓ "; }
.row-mini { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.w-qty { width: 80px; text-align: right; }
.itbl tr.editing textarea { min-height: 64px; }

.add-line {
  display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end;
  border-top: 1px solid var(--gold-line); margin: 6px -16px 0; padding: 16px;
}
.add-line .al-sel { flex: 1 1 340px; }
.add-line .al-note { flex: 1 1 220px; }
.add-line.js .al-custom { display: none; }
.add-line.js.is-custom .al-custom { display: flex; }
.add-line.js .al-side { display: none; }
.add-line.js.has-side .al-side, .add-line.js.is-custom .al-side { display: flex; }

.paycard { display: flex; gap: 30px; flex-wrap: wrap; align-items: flex-start; }
.pays { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; }
.payrow { display: grid; grid-template-columns: 100px 1fr auto 26px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #2E3136; }
.payadd { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.sums { flex: 0 0 240px; display: flex; flex-direction: column; gap: 8px; padding-left: 24px; border-left: 1px solid var(--gold-line); }
.sums div { display: flex; justify-content: space-between; gap: 10px; }
.sums div:first-child b { font: 400 26px/1 var(--serif); color: var(--gold); }
.sums .rest b { font-size: 18px; }
.flags label.check, .seg label.check { font-size: 15px; }
.cancel-form { margin-top: 14px; text-align: right; }
.members { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.bcard { margin-bottom: 14px; }
@media (max-width: 640px) {
  .headrow .btn { width: 100%; text-align: center; }
  .search { flex-wrap: wrap; }
  .sums { flex: 1 1 100%; padding-left: 0; border-left: 0; border-top: 1px solid var(--gold-line); padding-top: 12px; }
  .itbl tfoot tr { display: flex; justify-content: space-between; }
  .itbl tfoot td { display: block; }
  .tbl td.ono::before { content: "№ "; }
  .stage-steps .step { font-size: 12.5px; padding: 5px 9px; }
}

/* ---------- выбор комплекта ---------- */
.kitpick { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px 18px; align-items: end; }
.kitpick .kp-ck { grid-column: span 1; }
.kitpick .kp-help { grid-column: 1 / -1; margin: 0; }
.kitpick.js .kp-ck { display: none; }
.kitpick.js.is-ck .kp-ck { display: flex; }
.kitpick.js .kp-thick { display: none; }
.kitpick.js.is-kit .kp-thick { display: flex; }
.kitpick.js.is-ck .kp-help { display: block; }
.add-line.js .al-thick, .add-line.js .al-ck { display: none; }
.add-line.js.is-kit .al-thick, .add-line.js.is-ck .al-ck { display: flex; }
.w-size { width: 130px; }
@media (max-width: 640px) { .kitpick { grid-template-columns: 1fr; } }

/* ---------- свой комплект ---------- */
.kp-wide, .al-wide { grid-column: 1 / -1; flex: 1 1 100%; display: block; }
.add-line.js .al-wide { display: none; }
.add-line.js.is-ck .al-wide { display: block; }
.kb-rows { display: flex; flex-direction: column; gap: 8px; }
.kb-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 210px 64px 40px; gap: 8px; align-items: center; }
.kb.js .kb-spare { display: none; }
.kb-qty { text-align: center; }
.kb-del { background: transparent; border: 1px solid var(--edge); color: var(--muted); height: 46px; cursor: pointer; font-size: 18px; }
.kb-del:hover { color: #F08A80; border-color: #8E2F29; }
.kb-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.kb-help { margin-top: 8px; }
.kb:not(.js) .kb-add, .kb:not(.js) .kb-del { display: none; }
@media (max-width: 640px) { .kb-row { grid-template-columns: 1fr 64px 40px; padding-bottom: 8px; border-bottom: 1px solid #2E3136; } .kb-row select[name=ck_type], .kb-row input[name=ck_size] { grid-column: 1 / -1; } }
.kitpick.js.is-ck .kp-wide { display: block; }
.kitpick .kp-wide { grid-column: 1 / -1; }

.add-line.js .al-stone { display: none; }
.add-line.js.is-p .al-stone, .add-line.js.is-custom .al-stone { display: flex; }
.chip-stone { border-color: #5C6068; color: #C9CDD3; }
.topsearch { flex: 1 1 260px; max-width: 420px; margin: 0 8px; }
.topsearch input { min-height: 38px; padding: 7px 12px; background: rgba(0,0,0,.45); border-color: #3A3D43; font-size: 15px; }
.w-by { width: auto; flex: 0 0 auto; }
@media (max-width: 640px) { .topsearch { order: 3; flex-basis: 100%; max-width: none; margin: 4px 0 0; } }
.add-line.js .al-pl { display: none; }
.add-line.js.is-pl .al-pl { display: grid; }
.add-line.js.is-pl .al-cfor, .add-line.js.is-custom .al-cfor { display: flex; }
.pl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
.pl-grid .pl-title { grid-column: span 3; }
.pl-grid .pl-bg { grid-column: span 2; }
@media (max-width: 760px) { .pl-grid { grid-template-columns: 1fr 1fr; } .pl-grid .pl-title, .pl-grid .pl-bg { grid-column: 1 / -1; } }
.danger-zone { margin-top: 40px; padding: 16px 18px; border: 1px dashed #8E2F29; background: rgba(176,50,44,.07); }
.danger-zone h2 { margin: 0 0 10px; font-size: 16px; color: #F08A80; }
.plaque-box { display: none; }
form.js.is-plaque .plaque-box { display: grid; }
form.js.is-plaque .mono-only { display: none; }
form:not(.js) .plaque-box { display: grid; }
.head-acts { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.head-acts .chipbtn { text-decoration: none; padding: 13px 16px; }
.logo-img { width: 44px; height: 44px; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.6)); }
.login-logo { width: 190px; height: 190px; filter: drop-shadow(0 8px 18px rgba(0,0,0,.75)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.clear-form { display: flex; gap: 16px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px; font-size: 14px; }
.clear-form label.check { font-size: 14px; color: var(--muted); }
.form-acts { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }

/* ---------- фото ---------- */
.ptitle { font-weight: 600; margin-bottom: 8px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumbs figure { margin: 0; width: 120px; }
.thumbs img { width: 120px; height: 120px; object-fit: cover; display: block; border: 1px solid var(--edge); background: #000; }
.thumbs.big figure, .thumbs.big img { width: 150px; }
.thumbs.big img { height: 150px; }
.thumbs a > img:hover { border-color: var(--gold); }
.thumbs > a > img { width: 96px; height: 96px; }
.thumbs figcaption { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; }
.upload { display: flex; gap: 12px 14px; align-items: flex-end; flex-wrap: wrap; border-top: 1px solid #2E3136; padding-top: 14px; }
.upload label { flex: 1 1 200px; }
.up-file { position: relative; display: inline-flex !important; align-items: center; justify-content: center; flex-direction: row !important;
  min-height: 46px; padding: 10px 16px; border: 1px dashed rgba(217,182,94,.6); color: var(--gold) !important; font-weight: 600; cursor: pointer; font-size: 15px !important; }
.up-file:hover { background: rgba(217,182,94,.08); }
.up-file input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.up-file.big { min-height: 56px; font-size: 16px !important; }
.up-file.done { border-style: solid; border-color: #3E6A3A; color: #A9D69B !important; }
.wrow { padding: 10px 0; border-top: 1px solid #2E3136; display: flex; flex-direction: column; gap: 8px; }
.wname { font-weight: 600; }
.redo-box.fixed { background: rgba(98,160,90,.12); border-color: #3E6A3A; border-left-color: #62A05A; color: #D6EDD0; }
.redo-box.fixed .bang { background: #62A05A; }

/* ---------- задания работников ---------- */
.tasklist { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.task { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; text-decoration: none; color: var(--ink); border-left: 3px solid transparent; }
.task.urgent { border-left-color: var(--gold); }
.task.redo { border-left-color: #C0392B; background: rgba(176,50,44,.14); }
.tasklist.done .task { background: var(--slab); border: 1px solid var(--edge); }
.task-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.task-name { font: 400 26px/1.15 var(--serif); color: var(--gold); }
.task-sub { color: var(--muted); font-size: 14.5px; }
.task-redo { color: #F08A80; font-weight: 600; font-size: 15px; }
.info-card { margin: 14px 0; gap: 8px; }
.titems { display: flex; flex-direction: column; gap: 10px; }
.titem { background: var(--slab); border: 1px solid var(--edge); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.titem.other { opacity: .6; }
.titem-name { font-weight: 600; font-size: 16.5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bigready { width: 100%; min-height: 54px; font: 600 16px var(--sans); cursor: pointer; border: 1px dashed rgba(217,182,94,.6); background: transparent; color: var(--gold); }
.bigready.on { background: rgba(98,160,90,.2); border: 1px solid #3E6A3A; color: #A9D69B; }
.upload-row .up-file { width: 100%; min-height: 54px; }
.finish { margin-top: 20px; }
.finish .btn { width: 100%; }
.btn:disabled { filter: grayscale(1) brightness(.6); cursor: not-allowed; }

/* ---------- новый заказ: конструктор ---------- */
.neworder { display: flex; flex-direction: column; gap: 16px; }
.nsec { display: flex; flex-direction: column; gap: 14px; }
.nsec.grid2 { display: grid; }
.nh { font: 400 24px/1.2 var(--serif); color: var(--gold); margin: 0; }
.nrow { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.nrow > label { flex: 1 1 180px; }
.nrow > label.grow { flex: 3 1 260px; }
.nrow > label.w-small { flex: 0 1 130px; }
.nrow > label.w-num2 { flex: 0 1 160px; }
.nrow > label.check.pad { flex: 0 1 auto; padding-bottom: 12px; }
.landgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.other { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid #2E3136; padding-top: 12px; }
.neworder .plaque-box { display: none; }
.neworder.js.is-plaque .plaque-box { display: grid; }
.neworder.js.is-plaque .mono-only { display: none; }
.neworder.js.is-pickup .inst-only { display: none; }
.neworder:not(.js) .plaque-box { display: grid; }
.plaque-box .nh { grid-column: 1 / -1; }
@media (max-width: 640px) { .landgrid { grid-template-columns: 1fr 1fr; } }
.done-line { color: #A9D69B; font-weight: 600; }
.done-btns { display: flex; flex-direction: column; gap: 8px; }
.done-btns .linkbtn:disabled, .bigready:disabled { opacity: .45; cursor: not-allowed; }
.titem.isdone { border-color: #3E6A3A; background: linear-gradient(170deg, rgba(98,160,90,.08), rgba(0,0,0,0) 60%), var(--slab); }
.trip { display: flex; gap: 14px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid #2E3136; flex-wrap: wrap; }
.pnote.mm { color: var(--gold); }
.paper-form summary { cursor: pointer; color: var(--gold); }
.paper-form form { margin-top: 10px; }

/* новый заказ: макет и фото сразу */
.nphotos { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.nphotos .up-file { min-width: 190px; }

/* выбор из прайса или «своё» */
.pick, .pick-c { display: contents; }
.pick.js:not(.is-c) .pick-c { display: none; }
.nrow .pick > label, .nrow .pick-c > label { flex: 1 1 180px; }
.nrow .pick-c > label.grow { flex: 3 1 220px; }
.nrow .pick-c > label.w-num2 { flex: 0 1 150px; }
.nrow .pick > label.w-small { flex: 0 1 120px; }
.nrow .pick-c > label.check.pad { flex: 0 1 auto; padding-bottom: 12px; }
/* доп. надгробие */
.tomb.js:not(.is-len) .tomb-c, .tomb.js:not(.is-th) .tomb-th { display: none; }
.tomb.js:not(.is-on) .nrow + .nrow, .tomb.js:not(.is-on) .nrow > label:not(:first-child) { display: none; }

/* эскиз памятника для клиента */
.sketch-box { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin: 14px 0 16px;
  padding: 12px 16px; border: 1px solid rgba(217,182,94,.45); background: rgba(217,182,94,.07); }
.sketch-box.sk-sent { border-color: rgba(92,138,194,.6); background: rgba(92,138,194,.08); }
.sketch-box.sk-no { border-color: #C0392B; background: rgba(192,57,43,.08); }
.sk-acts { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }

/* склад */
.tabs .cnt { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--gold); color: #1a1a1a; font-size: 12px; text-align: center; }
.stbl tr.low td.qty { color: var(--gold-hi); }
.stbl tr.neg td.qty { color: #F08A80; }
.stbl td.plus { color: #A9D69B; }
.stbl td.minus { color: #F08A80; }
.dlist { display: grid; gap: 10px; }
.task.done-task { opacity: .75; }
.add-del { margin-bottom: 14px; }
.add-del > summary { list-style: none; cursor: pointer; display: inline-flex; }
.add-del > summary::-webkit-details-marker { display: none; }
.dlines { display: grid; gap: 10px; }
.dline { border: 1px solid var(--edge); background: rgba(20,22,25,.78); padding: 14px 16px; display: grid; gap: 10px; }
.dline.ok { border-color: rgba(98,160,90,.7); }
.dline.short { border-color: #C0392B; }
.dline.extra { border-color: rgba(217,182,94,.7); }
.dl-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dl-qty { white-space: nowrap; }
.dl-res { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.ok-t { color: #A9D69B; font-weight: 600; }
.short-t { color: #F08A80; font-weight: 600; }
.extra-t { color: var(--gold-hi); font-weight: 600; }
.dl-acts { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.dl-fact { display: flex; gap: 8px; align-items: flex-end; }
.dl-fact label { max-width: 130px; }
.dl-del { justify-self: start; }
[data-newitem].js:not(.is-new) .ni-new { display: none; }
.stock-box .srow { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--edge); }
.stock-box .srow:last-child { border-bottom: 0; }
.stock-box .neg { color: #F08A80; }

/* «Начали работу», сроки, календарь */
.start-form { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 6px 0 18px; }
.started-note { color: #A9D69B; font-weight: 600; margin: 6px 0 14px; }
.cal-box { margin-bottom: 16px; display: grid; gap: 6px; }
.cal-row, .cal-ev { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 1px solid var(--edge); }
.cal-row:last-child, .cal-ev:last-child { border-bottom: 0; }
.cal-row:hover b, .cal-ev:hover b { color: var(--gold-hi); }
.cal-brig { display: grid; gap: 2px; margin-top: 4px; }
.cal-nav { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 8px 0 12px; }
.cal-title { margin: 0; min-width: 170px; text-align: center; }
.cal-filter { margin-left: auto; }
.cal-days { display: grid; gap: 10px; }
.cal-day { border: 1px solid var(--edge); background: rgba(20,22,25,.78); padding: 12px 16px; }
.cal-day.today { border-color: rgba(217,182,94,.75); }
.cal-day.past { opacity: .82; }
.cal-dh { margin-bottom: 4px; }
@media (max-width: 640px) { .cal-filter { margin-left: 0; width: 100%; } .cal-filter select { width: 100%; } }
