/* ─────────────────────────────────────────────
   Сдано. — кабинет заказа
   ───────────────────────────────────────────── */

.cab-body { overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cab {
  display: grid; height: 100svh;
  grid-template-columns: 320px minmax(0, 1fr) 400px;
  grid-template-rows: 68px minmax(0, 1fr);
  grid-template-areas: "top top top" "stages stage chat";
}

.cab-label {
  margin: 0; font-family: var(--f-cond); font-weight: 800; font-size: 15px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-3);
}

/* ── top ──────────────────────────────────── */

.cab-top {
  grid-area: top; display: flex; align-items: center; gap: 28px; padding: 0 20px;
  border-bottom: 1px solid var(--line); background: var(--night);
}
.cab-top__order { min-width: 0; padding-left: 28px; border-left: 1px solid var(--line); }
.cab-top__title { margin: 0; font-family: var(--f-cond); font-weight: 900; font-size: 22px; line-height: 1.05; text-transform: uppercase; letter-spacing: .01em; white-space: nowrap; }
.cab-top__title span { color: var(--text-3); font-weight: 700; }
.cab-top__meta { margin: 2px 0 0; font-size: 14px; color: var(--text-2); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.cab-top__meta i { color: var(--red); }
.cab-top__left { color: var(--text-3); }
.cab-top__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.cab-top__right .tag { color: var(--acid); }
.cab-demo {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; cursor: pointer;
  background: none; color: var(--text); border: 1px dashed var(--line-2); border-radius: var(--r);
  font-family: var(--f-cond); font-weight: 800; font-size: 16px; letter-spacing: .05em; text-transform: uppercase;
  transition: border-color .2s, color .2s;
}
.cab-demo:hover { border-color: var(--acid); color: var(--acid); }
.cab-demo[disabled] { opacity: .4; cursor: default; }
.cab-top__me { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--night-3); font-size: 18px; }

/* ── stages column ────────────────────────── */

.cab-stages {
  grid-area: stages; overflow: auto; border-right: 1px solid var(--line); display: flex; flex-direction: column;
  scrollbar-width: thin;
}
.cab-stages__head { padding: 22px 20px 18px; border-bottom: 1px solid var(--line); }
.cab-paid { margin: 8px 0 12px; font-family: var(--f-cond); font-weight: 900; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.cab-paid small { font-family: var(--f-body); font-weight: 500; font-size: 14px; color: var(--text-3); margin-left: 4px; }
.cab-meter { height: 4px; border-radius: 4px; background: var(--night-3); overflow: hidden; }
.cab-meter span { display: block; height: 100%; width: 100%; background: var(--acid); border-radius: inherit; transform-origin: left; transform: scaleX(.4); transition: transform .8s var(--ease-out); }

.cab-lineup { list-style: none; margin: 0; padding: 8px 0; flex: 1; }
.cab-lineup button {
  width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 12px 20px; background: none; border: 0; color: var(--text); text-align: left; cursor: pointer; font: inherit;
  position: relative; transition: background-color .2s;
}
.cab-lineup button:hover { background: var(--night-1); }
.cab-lineup button.is-sel { background: var(--night-2); box-shadow: inset 0 1px 0 var(--line-2), inset 0 -1px 0 var(--line-2); }
.cab-lineup button.is-sel .cab-lineup__name { color: var(--text); }
.cab-lineup__no { font-family: var(--f-cond); font-weight: 900; font-size: 30px; line-height: 1; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cab-lineup__name { display: block; font-family: var(--f-cond); font-weight: 900; font-size: 21px; text-transform: uppercase; letter-spacing: .015em; line-height: 1.05; }
.cab-lineup__sub { display: block; font-size: 13px; color: var(--text-3); margin-top: 2px; }
.cab-lineup__st { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-cond); font-weight: 800; font-size: 14px; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-paid { color: var(--acid); }
.st-review { color: var(--ink); background: var(--red); padding: 4px 8px 3px; border-radius: 100px; }
.st-work { color: var(--text); }
.st-fix { color: var(--red-hot); }
.st-next { color: var(--text-3); }
.cab-lineup li.is-paid .cab-lineup__no { color: var(--acid); }
.cab-lineup li.is-review .cab-lineup__no, .cab-lineup li.is-work .cab-lineup__no { color: var(--red); }
.cab-lineup li.is-next .cab-lineup__name { color: var(--text-2); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: rec 1.4s ease-in-out infinite; }

.cab-stages__foot { padding: 18px 20px 22px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.cab-stages__foot p { margin: 0 0 10px; display: flex; gap: 8px; }
.cab-stages__foot i { color: var(--acid); font-size: 18px; flex: none; }
.cab-link { background: none; border: 0; padding: 0; color: var(--text-3); font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.cab-link:hover { color: var(--red-hot); }

/* ── stage view ───────────────────────────── */

.cab-stage { grid-area: stage; overflow: auto; position: relative; scrollbar-width: thin; }
.cab-stage:focus { outline: none; }
.sv { max-width: 860px; margin: 0 auto; padding: 36px clamp(20px, 3vw, 48px) 0; }
.sv__head { display: grid; grid-template-columns: auto 1fr; gap: 4px 20px; align-items: end; padding-bottom: 22px; border-bottom: 3px solid var(--text); }
.sv__no { grid-row: span 2; font-family: var(--f-cond); font-weight: 900; font-size: clamp(72px, 7vw, 112px); line-height: .78; color: var(--red); font-variant-numeric: tabular-nums; }
.sv__title { margin: 0; font-family: var(--f-wide); font-weight: 700; font-size: clamp(28px, 3vw, 44px); letter-spacing: -.04em; line-height: 1; display: flex; align-items: baseline; }
.sv__status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-size: 15px; color: var(--text-2); }
.sv__status .cab-lineup__st { font-size: 15px; }

.sv__note { display: grid; grid-template-columns: 40px 1fr; gap: 14px; margin: 26px 0; }
.sv__note .cab-ava { width: 40px; height: 40px; font-size: 13px; }
.sv__note p { margin: 0; font-size: 18px; line-height: 1.5; }
.sv__note small { display: block; margin-top: 6px; font-size: 13px; color: var(--text-3); }

.sv__sec { margin: 30px 0; }
.sv__sec > .cab-label { margin-bottom: 12px; }
.sv__files { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.fcard {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px;
  background: var(--night-1); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none;
  transition: border-color .2s, background-color .2s;
}
.fcard:hover { border-color: var(--line-2); background: var(--night-2); }
.fcard > i { font-size: 30px; color: var(--red); }
.fcard b { display: block; font-weight: 700; font-size: 15px; line-height: 1.2; word-break: break-word; }
.fcard small { color: var(--text-3); font-size: 13px; }
.fcard .ph-download-simple { font-size: 20px; color: var(--text-2); }

.sheet {
  background: var(--sheet); color: var(--ink); border-radius: var(--r); padding: clamp(18px, 2.4vw, 30px);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9);
}
.sheet .src li { font-size: 16px; }
.sheet .src a { color: var(--ink); text-decoration: none; display: flex; justify-content: space-between; gap: 12px; width: 100%; }
.sheet .src a:hover span { text-decoration: underline; }
.sheet .src small { display: block; font-weight: 400; color: var(--ink-2); font-size: 13px; }
.sheet .toc li { font-size: 16px; }
.sheet dl div { grid-template-columns: 160px 1fr; }
.sheet .page__p { font-size: 17px; }
.sheet .report__row { font-size: 16px; }
.sheet--dim { opacity: .55; filter: grayscale(.4); }
.sheet__lock { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 15px; margin: 0; }
.sheet__lock i { font-size: 22px; color: var(--red); }

.sv__hist { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-2); }
.sv__hist li { position: relative; padding: 0 0 16px 20px; font-size: 15px; color: var(--text-2); }
.sv__hist li::before { content: ""; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--night); border: 2px solid var(--text-3); }
.sv__hist li.is-ok::before { border-color: var(--acid); background: var(--acid); }
.sv__hist time { color: var(--text-3); font-size: 13px; margin-right: 8px; font-variant-numeric: tabular-nums; }

.sv__actions {
  position: sticky; bottom: 0; z-index: 3; margin: 36px calc(-1 * clamp(20px, 3vw, 48px)) 0; padding: 16px clamp(20px, 3vw, 48px) calc(16px + env(safe-area-inset-bottom));
  padding-top: 36px;
  background: linear-gradient(180deg, rgba(11, 11, 12, 0), var(--night) 34px);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.sv__actions .btn--ghost { background: var(--night); }
.sv__actions .btn--ghost:hover { background: var(--night-2); }
.sv__actions .btn--red { flex: 1 1 320px; }
.sv__actions .btn--ghost { flex: 0 1 auto; }
.sv__actions p { flex: 1 1 100%; margin: 0; font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.sv__actions p i { color: var(--acid); }

.fix {
  margin-top: 16px; padding: 16px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--night-1);
  display: grid; gap: 12px;
}
.fix[hidden] { display: none; }
.fix textarea {
  width: 100%; min-height: 110px; resize: vertical; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--text);
  background: var(--night); border: 1px solid var(--line-2); border-radius: var(--r);
}
.fix textarea:focus { outline: none; border-color: var(--paper); box-shadow: 0 0 0 3px rgba(255, 59, 31, .35); }
.fix__row { display: flex; gap: 10px; flex-wrap: wrap; }

.sv-work {
  display: flex; align-items: center; gap: 16px; padding: 22px; margin: 26px 0; border: 1px dashed var(--line-2); border-radius: var(--r);
}
.sv-work .eq { height: 22px; color: var(--red); }
.sv-work .eq i { width: 4px; }
.sv-work p { margin: 0; }
.sv-work b { display: block; font-family: var(--f-cond); font-weight: 900; font-size: 22px; text-transform: uppercase; letter-spacing: .02em; }
.sv-work span { color: var(--text-2); font-size: 15px; }

.sv-done { text-align: left; padding: 40px 0; }
.sv-done .stamp { font-size: clamp(56px, 7vw, 96px); }

/* ── chat ─────────────────────────────────── */

.cab-chat { grid-area: chat; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--night-1); }
.cab-chat__head { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cab-ava {
  width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: var(--ink); display: grid; place-items: center;
  font-family: var(--f-wide); font-weight: 800; font-size: 14px; letter-spacing: -.04em; flex: none;
}
.cab-chat__name { margin: 0; font-weight: 800; font-size: 17px; line-height: 1.2; }
.cab-chat__status { margin: 0; font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.dot-online { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); }
.cab-icon {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: none; border: 1px solid var(--line);
  color: var(--text-2); font-size: 19px; cursor: pointer; transition: border-color .2s, color .2s; flex: none;
}
.cab-icon:hover { border-color: var(--line-2); color: var(--text); }

.cab-chat__log { flex: 1; overflow: auto; padding: 18px 14px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.cm { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 15px; line-height: 1.4; animation: cm-in .5s var(--ease-out); }
@keyframes cm-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.cm time { display: block; margin-top: 4px; font-size: 11.5px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
.cm--in { align-self: flex-start; background: var(--night-3); border-bottom-left-radius: 4px; }
.cm--out { align-self: flex-end; background: var(--paper); color: var(--ink); border-bottom-right-radius: 4px; }
.cm--out time { color: var(--ink-2); }
.cm--sys {
  align-self: center; max-width: 94%; background: none; padding: 6px 0; text-align: center;
  font-family: var(--f-cond); font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
  display: flex; align-items: center; gap: 6px;
}
.cm--sys.is-ok { color: var(--acid); }
.cm--file { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; }
.cm--file > i { font-size: 30px; color: var(--red); }
.cm--file b { display: block; font-size: 14.5px; }
.cm--file small { color: var(--text-3); font-size: 12.5px; }
.cm--file p { grid-column: 1 / -1; margin: 4px 0 0; }
.cm--typing { display: flex; gap: 4px; padding: 14px; }
.cm--typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: typing 1.2s infinite; }
.cm--typing span:nth-child(2) { animation-delay: .15s; } .cm--typing span:nth-child(3) { animation-delay: .3s; }
.cm-day { align-self: center; font-size: 12px; color: var(--text-3); padding: 4px 10px; border-radius: 100px; background: var(--night-2); margin: 8px 0 2px; }

.cab-chat__form { display: grid; grid-template-columns: 40px 1fr 44px; gap: 8px; align-items: center; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.cab-chat__form input {
  height: 44px; border-radius: 100px; padding: 0 16px; border: 1px solid var(--line); background: var(--night); color: var(--text); font: inherit; font-size: 15px;
}
.cab-chat__form input:focus { outline: none; border-color: var(--line-2); box-shadow: 0 0 0 3px rgba(255, 59, 31, .3); }
.cab-send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--red); color: var(--ink); font-size: 20px; display: grid; place-items: center; cursor: pointer; transition: background-color .2s, transform .2s var(--ease-out); }
.cab-send:hover { background: var(--red-hot); }
.cab-send:active { transform: scale(.94); }

/* ── pay sheet ────────────────────────────── */

.pay-sheet {
  width: min(460px, calc(100vw - 24px)); padding: 0; border: 0; border-radius: 6px; background: var(--night-1); color: var(--text);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .8);
}
.pay-sheet::backdrop { background: rgba(0, 0, 0, .7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pay-sheet[open] { animation: sheet-in .5s var(--ease-out); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(30px) scale(.97); } }
.pay-sheet__inner { padding: 20px; display: grid; gap: 18px; }
.pay-sheet__head { display: flex; justify-content: space-between; align-items: center; }
.pay-sheet .btn.is-ok { background: var(--acid); color: var(--ink); opacity: 1; }
.pay-sheet__note { margin: 0; font-size: 13px; color: var(--text-3); }

.receipt {
  position: relative; background: var(--sheet); color: var(--ink); padding: 22px 22px 34px; font-family: var(--f-cond); font-size: 18px;
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 20px 10px repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 20px 10px repeat-x;
}
.receipt__shop { margin: 0 0 14px; text-align: center; font-family: var(--f-wide); font-weight: 800; font-size: 26px; letter-spacing: -.04em; display: flex; justify-content: center; align-items: baseline; }
.receipt__line { margin: 0; display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line-ink-2); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.receipt__line--muted { color: var(--ink-2); font-weight: 600; }
.receipt__total { margin: 12px 0 0; display: flex; justify-content: space-between; font-weight: 900; font-size: 34px; text-transform: uppercase; line-height: 1; font-variant-numeric: tabular-nums; }
.receipt__stamp { position: absolute; right: 18px; top: 46%; font-size: 40px; opacity: 0; pointer-events: none; }
.receipt.is-paid .receipt__stamp { animation: slam .5s var(--ease-out) forwards; }

.pay-methods { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-methods legend { margin-bottom: 10px; }
.pay-methods label { position: relative; cursor: pointer; }
.pay-methods input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pay-methods span {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border: 1px solid var(--line-2); border-radius: var(--r);
  font-family: var(--f-cond); font-weight: 900; font-size: 20px; text-transform: uppercase; letter-spacing: .03em; transition: all .2s;
}
.pay-methods span i { font-size: 20px; }
.pay-methods input:checked + span { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.pay-methods input:focus-visible + span { outline: 2px solid var(--acid); outline-offset: 3px; }

/* ── toast ────────────────────────────────── */

.cab-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 90; translate: -50% 0;
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 100px;
  background: var(--acid); color: var(--ink); font-weight: 700; font-size: 15px; box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .7);
  animation: toast-in .5s var(--ease-out);
}
.cab-toast[hidden] { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } }

/* ── tabs (mobile) ────────────────────────── */

.cab-tabs { display: none; }

@media (max-width: 1180px) {
  .cab { grid-template-columns: 280px minmax(0, 1fr) 340px; }
  .cab-demo span { display: none; }
  .cab-demo { width: 40px; padding: 0; justify-content: center; }
}

@media (max-width: 900px) {
  .cab {
    grid-template-columns: 1fr;
    grid-template-rows: 60px minmax(0, 1fr) calc(62px + env(safe-area-inset-bottom));
    grid-template-areas: "top" "main" "tabs";
  }
  .cab-top { gap: 14px; padding: 0 14px; }
  .cab-top .logo { display: none; }
  .cab-top__order { border: 0; padding: 0; }
  .cab-top__title { font-size: 19px; }
  .cab-top__meta { font-size: 13px; }
  .cab-top__left { display: none; }
  .cab-top__me { display: none; }
  .cab-top__right .tag { display: none; }
  .cab-stages, .cab-stage, .cab-chat { grid-area: main; border: 0; }
  .cab [data-panel] { display: none; }
  .cab [data-panel].is-on { display: flex; }
  .cab .cab-stage.is-on { display: block; }
  .sv { padding-top: 22px; }
  .sv__head { grid-template-columns: auto 1fr; align-items: center; gap: 12px 14px; padding-bottom: 16px; }
  .sv__no { grid-row: auto; font-size: 64px; }
  .sv__title { font-size: 30px; }
  .sv__status { grid-column: 1 / -1; font-size: 14px; }
  .sv__note p { font-size: 17px; }
  .sv__actions { position: static; background: none; margin: 28px 0 0; padding: 0 0 28px; }
  .sv__actions .btn { flex: 1 1 100%; }
  .sv__note { margin: 18px 0; }
  .sv__sec { margin: 22px 0; }

  .cab-tabs {
    grid-area: tabs; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: var(--night);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .cab-tabs button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    background: none; border: 0; color: var(--text-3); cursor: pointer;
    font-family: var(--f-cond); font-weight: 800; font-size: 14px; letter-spacing: .06em; text-transform: uppercase;
  }
  .cab-tabs i { font-size: 22px; }
  .cab-tabs button.is-on { color: var(--text); }
  .cab-tabs button.is-on i { color: var(--red); }
  .cab-badge { position: absolute; top: 8px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 10px; background: var(--red); color: var(--ink); font-size: 12px; display: grid; place-items: center; }
  .cab-badge[hidden] { display: none; }
  .cab-toast { bottom: calc(80px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }
  .sheet dl div { grid-template-columns: 110px 1fr; }
}
