/* Новый вид, этап 3: карточка клиента, отчёт клиенту, шторка «⋯». Классы ncl-. Цвета — токены ios.css (светлая и тёмная тема). */

/* ---------- шторка ---------- */
.ncl-sheet-back { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; justify-content: center;
  animation: nclFade .18s ease-out; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.ncl-sheet { width: 100%; max-width: 420px; max-height: 92vh; overflow-y: auto; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); animation: nclUp .22s ease-out; }
.ncl-sg { background: var(--card, #fff); border-radius: 14px; overflow: hidden; margin-top: 8px; }
.ncl-sh { padding: 12px 16px; text-align: center; font-size: 13px; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.ncl-si { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 16px; font-size: 17px; color: var(--accent);
  background: none; border: 0; border-radius: 0; text-align: left; cursor: pointer; text-decoration: none; position: relative; justify-content: flex-start; }
.ncl-si + .ncl-si::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--nu-sep); }
.ncl-si:hover { background: var(--soft); color: var(--accent); }
.ncl-si .ncl-ic { flex: none; display: inline-flex; width: 22px; justify-content: center; }
.ncl-si .ncl-tx { flex: 1; min-width: 0; }
.ncl-si .ncl-tx b { display: block; font-weight: 500; overflow-wrap: anywhere; }
.ncl-si .ncl-tx small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.ncl-si.danger, .ncl-si.danger:hover { color: var(--bad); }
.ncl-si.cancel { justify-content: center; font-weight: 600; }
.ncl-si.soon { color: var(--faint); cursor: default; }
.ncl-si.soon:hover { background: none; }
.ncl-soon { flex: none; font-size: 12px; color: var(--faint); border: .5px solid var(--nu-sep); border-radius: 999px; padding: 2px 8px; }
@keyframes nclUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes nclFade { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 701px) { .ncl-sheet { margin-bottom: 24px; } }

/* ---------- карточка клиента ---------- */
.ncl-back { display: inline-block; font-size: 15px; margin: 2px 0 6px; color: var(--accent); }
.ncl-actions { display: flex; gap: 8px; align-items: center; }
.ncl-dots { background: var(--soft-2) !important; color: var(--text); border: 0; border-radius: 999px; width: 36px; height: 36px; min-height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ncl-dots:hover { filter: brightness(.95); }
.ncl-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.ncl-top .nu-goal { min-width: 0; }
.ncl-why { margin-top: 10px; font-size: 14px; }
.ncl-why summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.ncl-why ul { margin: 8px 0 6px 18px; padding: 0; color: var(--muted); }
.ncl-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 22px 0 14px; padding-bottom: 2px; }
.ncl-tabs::-webkit-scrollbar { display: none; }
.ncl-tabs a { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--card); color: var(--text); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.ncl-tabs a:hover { color: var(--text); background: var(--soft-2); }
.ncl-tabs a.on { background: var(--accent); color: #fff; font-weight: 600; }
.ncl-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.ncl-q { background: var(--card); border: 0; border-radius: 10px; min-height: 36px; padding: 6px 12px; font-size: 15px; color: var(--text); flex: 1 1 200px; max-width: 320px; }
.ncl-item .t b a { color: var(--text); }
.ncl-item .t b a:hover { color: var(--accent); }
.ncl-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.ncl-bars > span { flex: 1; min-width: 2px; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.ncl-bars i { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; display: block; transition: opacity .1s; }
.ncl-bars > span:hover i { opacity: .7; }
.ncl-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.ncl-score { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: var(--good-fill); }
.ncl-score.mid { background: var(--warn-fill); } .ncl-score.bad { background: var(--bad-fill); }
.ncl-rt, .ncl-ans { white-space: pre-line; }
.ncl-ans { color: var(--accent) !important; }
.ncl-when { flex: none; white-space: nowrap; }
.ncl-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }

/* ---------- отчёт ---------- */
.ncl-rep-new { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 10px; align-items: end; }
.ncl-rep-new select, .ncl-rep-new input { width: 100%; }
.ncl-acts { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; align-items: center; }
.ncl-rep { margin-top: 12px; }
.ncl-rep-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 18px; margin-bottom: 12px; flex-wrap: wrap; }
.ncl-rep-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .ncl-top { grid-template-columns: minmax(0, 1fr); }
  .ncl-rep-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .ncl-rep-new { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ncl-rep-new > div:first-child, .ncl-rep-new > div:last-child { grid-column: 1 / -1; }
  .ncl-q { max-width: none; flex-basis: 100%; }
  .ncl-actions .nu-pill { padding: 7px 12px; }
  .ncl-when { display: none; }
  .ncl-page { min-width: 0; overflow-x: hidden; }
}

/* ---------- PDF: печатаем только отчёт ---------- */
@media print {
  body.ncl-printing .nu-top, body.ncl-printing .sidebar, body.ncl-printing .ncl-noprint, body.ncl-printing .ncl-back,
  body.ncl-printing .ncl-top, body.ncl-printing .ncl-tabs, body.ncl-printing .nu-head, body.ncl-printing .toast { display: none !important; }
  body.ncl-printing, body.ncl-printing .main { background: #fff !important; color: #000 !important; }
  body.ncl-printing .layout { display: block !important; }
  body.ncl-printing .nu-stat, body.ncl-printing .nu-group, body.ncl-printing .nu-card { break-inside: avoid; border: .5px solid #ccc; }
}
