/* Часть стилей ЗамерПро. Исходный public/css/app.css разбит для надёжной загрузки через туннель. */
.card:hover { border-color: #2b3d57; transform: translateY(-1px); box-shadow: var(--shadow-2); }
.card-top { display: flex; align-items: flex-start; gap: 10px; }
.card-ico { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-hi); }
.card-ico.ok { background: var(--ok-soft); color: var(--ok); }
.card-ico.warn { background: var(--warn-soft); color: var(--warn); }
.card-title { font-size: 14.5px; font-weight: 650; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.card-meter { height: 5px; border-radius: 99px; background: #1b2637; overflow: hidden; display: flex; }
.card-meter i { display: block; height: 100%; background: linear-gradient(90deg, #10b981, #34d399); }
.card-meter i.p2 { background: #3b82f6; }
.card-foot { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.card-foot .spacer { flex: 1; }

/* ---------------- строки ---------------- */
.row-list { display: flex; flex-direction: column; }
.row-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 16px; width: 100%;
  border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer;
}
.row-item:last-child { border-bottom: 0; }
.row-item:hover { background: var(--surface-2); }
.row-item .ri-ico { width: 31px; height: 31px; border-radius: 9px; background: var(--surface-3); color: var(--muted); display: grid; place-items: center; flex: none; }
.row-item .ri-main { flex: 1; min-width: 0; }
.row-item .ri-title { font-weight: 620; font-size: 13.5px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.row-item .ri-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 1px; display: flex; gap: 8px; flex-wrap: wrap; }
.row-item .ri-right { display: flex; align-items: center; gap: 9px; color: var(--muted-2); }

/* ---------------- узлы ---------------- */
.node-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 12px; }
.node-card {
  background: linear-gradient(175deg, #111a28, #0b111a); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.node-card:hover { border-color: #2f4467; transform: translateY(-1px); box-shadow: var(--shadow-2); }
.node-thumb { background: radial-gradient(120% 120% at 20% 0%, #16233a 0%, #0a1017 75%); border-bottom: 1px solid var(--line); padding: 4px 6px 0; }
.node-thumb svg { display: block; width: 100%; height: auto; }
.node-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.node-head { display: flex; align-items: center; gap: 7px; }
.node-name { font-weight: 650; font-size: 13.5px; }
.node-meta { font-size: 11.5px; color: var(--muted-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.node-dims { font-family: var(--mono); font-size: 11px; color: var(--ink-2); background: var(--field-bg-3); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; display: flex; gap: 9px; flex-wrap: wrap; }
.node-dims b { color: var(--ink); font-weight: 650; }
.node-dims span { color: var(--muted-2); }

/* ---------------- пустые состояния ---------------- */
.empty { text-align: center; padding: 42px 18px; color: var(--muted); }
.empty svg { width: 38px; height: 38px; color: #2b3a52; margin-bottom: 9px; }
.empty h3 { font-size: 14.5px; color: var(--ink-2); margin-bottom: 4px; }
.empty p { font-size: 12.5px; margin: 0 0 13px; }
.empty-inline { padding: 20px; text-align: center; color: var(--muted-2); font-size: 12.5px; }

/* ---------------- формы ---------------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 11.5px; font-weight: 650; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.field .hint { font-size: 11px; color: var(--muted-2); }
.input, .field input, .field select, .field textarea {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--field-bg); color: var(--ink); outline: 0; font-size: 13px;
  transition: border-color .14s, box-shadow .14s;
}
.field textarea { height: auto; padding: 9px 10px; resize: vertical; min-height: 68px; line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 130, 246, .16);
}
.input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 11px; }
.form-row { display: flex; gap: 9px; align-items: flex-end; flex-wrap: wrap; }

select.select {
  height: 36px; border: 1px solid var(--line-2); border-radius: 9px; background-color: var(--field-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238494ad' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding: 0 28px 0 10px; font-size: 13px; color: var(--ink); outline: 0; appearance: none;
}
select.select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 130, 246, .16); }

/* =========================================================
   Страница узла: 3D + панель замеров
   ========================================================= */
.node-layout { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 14px; align-items: start; }

.viewer {
  position: relative; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: radial-gradient(140% 110% at 30% 0%, #16233a 0%, #0a1017 62%, #070b11 100%);
  box-shadow: var(--shadow-1);
  min-height: 420px; display: flex; flex-direction: column;
}
.viewer-toolbar {
  position: absolute; z-index: 3; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap;
}
.tool-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  background: rgba(13, 20, 31, .78); border: 1px solid #243247; border-radius: 8px;
  color: var(--ink-2); font-size: 12px; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px);
}
.tool-btn:hover { background: rgba(30, 44, 64, .9); color: #fff; border-color: #33445e; }
.tool-btn.is-active { background: rgba(59, 130, 246, .2); border-color: rgba(59, 130, 246, .5); color: #bfdbfe; }
.tool-btn svg { width: 14px; height: 14px; }

.viewer-stage { flex: 1; display: grid; place-items: center; padding: 58px 14px 40px; cursor: grab; touch-action: none; min-height: 380px; }
.viewer-stage:active { cursor: grabbing; }
.viewer-stage svg { display: block; width: 100%; height: 100%; max-height: 62vh; }
.viewer-hint {
  position: absolute; left: 12px; bottom: 12px; z-index: 3; max-width: 300px;
  background: rgba(11, 17, 26, .82); border: 1px solid #1f2c3f; border-radius: 9px;
  padding: 8px 10px; font-size: 11px; color: var(--muted); line-height: 1.45; backdrop-filter: blur(6px);
}
.viewer-hint b { color: var(--ink-2); font-weight: 650; display: block; margin-bottom: 2px; font-size: 11.5px; }
.viewer-badge {
  position: absolute; top: 12px; right: 12px; z-index: 3; display: flex; gap: 6px; align-items: center;
}

.measure-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.mp-tabs { display: flex; border-bottom: 1px solid var(--line); }
.mp-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; height: 44px;
  border: 0; background: none; color: var(--muted); font-size: 12.5px; font-weight: 650; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.mp-tab:hover { color: var(--ink-2); background: var(--surface-2); }
.mp-tab.is-active { color: var(--accent-hi); border-bottom-color: var(--accent); }
.mp-tab .count { font-size: 10.5px; background: var(--surface-3); border-radius: 999px; padding: 1px 6px; }
.mp-head { display: flex; align-items: center; gap: 8px; padding: 11px 13px 8px; }
.mp-head .t { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--ink-2); }
.mp-head .spacer { flex: 1; }
.mp-unit { font-size: 11px; color: var(--muted-2); }
.mp-body { padding: 0 12px 12px; max-height: 560px; overflow: auto; scrollbar-width: thin; }
.mp-body::-webkit-scrollbar { width: 7px; }
.mp-body::-webkit-scrollbar-thumb { background: #1e2b3d; border-radius: 4px; }

.param-card {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) 128px; gap: 9px; align-items: center;
  background: linear-gradient(170deg, #121b29, #0d141f); border: 1px solid var(--line);
  border-radius: 11px; padding: 9px 10px; margin-bottom: 7px; transition: border-color .14s, box-shadow .14s;
}
.param-card:focus-within { border-color: rgba(59, 130, 246, .55); box-shadow: 0 0 0 3px rgba(59, 130, 246, .12); }
.param-card.is-note { border-color: rgba(139, 92, 246, .35); }
.pk {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(160deg, #312e81, #1e293b); border: 1px solid rgba(99, 102, 241, .35);
  color: #c7d2fe; font-weight: 700; font-size: 12px; font-family: var(--mono);
}
.pl { font-size: 12.5px; font-weight: 650; color: var(--ink); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.ph { font-size: 10.5px; color: var(--muted-2); margin-top: 2px; line-height: 1.3; }
.param-input { display: flex; align-items: center; height: 34px; background: var(--field-bg-2); border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.param-input input {
  width: 100%; min-width: 0; height: 100%; border: 0; outline: 0; background: none;
  text-align: right; padding: 0 5px 0 6px; font-size: 13px; font-weight: 650;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.param-input .u { font-size: 10.5px; color: var(--muted-2); padding: 0 5px 0 2px; }
.param-input .spin { display: flex; flex-direction: column; border-left: 1px solid var(--line-2); height: 100%; }
.param-input .spin button { flex: 1; width: 19px; border: 0; background: none; color: var(--muted-2); cursor: pointer; padding: 0; display: grid; place-items: center; font-size: 9px; line-height: 1; }
.param-input .spin button:hover { background: var(--surface-3); color: var(--ink); }
.param-note-btn {
  display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--line);
  background: var(--field-bg-3); color: var(--muted-2); border-radius: 7px; padding: 3px 6px;
  font-size: 10px; font-weight: 650; cursor: pointer; flex: none;
}
.param-note-btn:hover { color: var(--violet); border-color: rgba(139, 92, 246, .4); }
.param-note-btn.has-note { color: #c4b5fd; border-color: rgba(139, 92, 246, .45); background: rgba(139, 92, 246, .1); }
.param-note {
  grid-column: 2 / -1; display: flex; gap: 6px; align-items: center; margin-top: 2px;
}
.param-note input {
  flex: 1; height: 28px; background: var(--field-bg-2); border: 1px solid var(--line); border-radius: 7px;
  padding: 0 8px; font-size: 11.5px; outline: 0;
}
.param-note input:focus { border-color: var(--violet); }
.param-flag { margin-left: 2px; color: var(--violet); display: inline-flex; }

/* табы фото */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-3); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 6px;
  border: 0; background: rgba(8, 12, 20, .72); color: #fff; cursor: pointer; display: grid; place-items: center; opacity: 0;
}
.photo:hover .photo-del { opacity: 1; }
.photo-add {
  aspect-ratio: 1; border-radius: 10px; border: 1.5px dashed var(--line-2); display: grid; place-items: center;
  color: var(--muted-2); cursor: pointer; background: var(--field-bg-3); gap: 4px; font-size: 10.5px;
}
.photo-add:hover { border-color: var(--accent); color: var(--accent-hi); background: var(--accent-soft); }

/* статус */
.status-select { display: flex; gap: 3px; background: var(--field-bg); padding: 3px; border-radius: 9px; border: 1px solid var(--line); }
.status-select button {
  border: 0; background: none; padding: 5px 9px; border-radius: 7px; cursor: pointer;
  font-size: 11.5px; font-weight: 650; color: var(--muted-2); white-space: nowrap;
}
