/* Shared widget-level classes used by 2+ pages — buttons, form fields,
   tables, stats, chips, tooltips, modals, help/float panel, dropzone. */

.status{ display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:8px; font-size:12px; font-weight:600; border:1px solid var(--line); white-space:nowrap; }
.status-dot{ width:7px; height:7px; border-radius:50%; flex:none; background:var(--muted); }
.status.good{ color:var(--good-text); background:var(--good-bg); border-color:var(--good-border); }
.status.good .status-dot{ background:var(--good-text); }
.status.warn{ color:var(--warn-text); background:var(--warn-bg); border-color:var(--warn-border); }
.status.warn .status-dot{ background:var(--warn-text); }
.status.crit{ color:var(--crit-text); background:var(--crit-bg); border-color:var(--crit-border); }
.status.crit .status-dot{ background:var(--crit-text); }

.btn{
  height:34px; min-height:34px; border-radius:8px; border:1px solid var(--line);
  background:var(--bg); color:var(--border); font-size:13px; padding:0 12px; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; gap:6px; line-height:1;
  font-family:inherit;
}
.btn:hover{ border-color:var(--accent); }
.btn.primary{ background:var(--btn-primary-bg); color:#fff; border-color:var(--btn-primary-border); font-weight:600; }
.btn.primary:hover{ filter:brightness(1.08); }
.btn[disabled]{ opacity:0.5; cursor:not-allowed; }
.btn[disabled]:hover{ border-color:var(--line); filter:none; }
.btn:focus-visible, .tab:focus-visible, input:focus-visible, select:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

.field{ display:flex; flex-direction:column; gap:5px; margin-bottom:12px; }
.field:last-child{ margin-bottom:0; }
.field label{ font-size:12.5px; font-weight:600; display:flex; justify-content:space-between; align-items:baseline; }
.field label .val{ font-weight:700; color:var(--accent); font-variant-numeric:tabular-nums; }
.field-note{ font-size:11px; color:var(--muted); }

input[type=text], input[type=number], select, textarea{
  width:100%; border:1px solid var(--line); background:var(--bg); color:var(--border);
  border-radius:8px; padding:7px 9px; font-family:inherit; font-size:13px;
}
input[disabled], select[disabled]{ opacity:0.55; cursor:not-allowed; background:var(--panel); }
input[type=range]{ width:100%; accent-color:var(--accent); }
.two-up{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }

.chip-row{ display:flex; flex-wrap:wrap; gap:6px; }
.chip{
  padding:5px 12px; border-radius:8px; border:1px solid var(--line); background:var(--bg);
  color:var(--muted); font-size:12px; font-weight:600; cursor:pointer; font-family:inherit;
}
.chip:hover{ border-color:var(--accent); color:var(--accent); }
.chip.active{ background:var(--accent); border-color:var(--accent); color:#fff; }
.chip[disabled]{ cursor:not-allowed; opacity:0.5; }
.chip[disabled]:hover{ border-color:var(--line); color:var(--muted); }

.catalog-row{ display:flex; align-items:flex-start; gap:10px; padding:9px 2px; border-bottom:1px solid var(--line); cursor:pointer; }
.catalog-row:last-child{ border-bottom:none; }
.catalog-row input{ margin-top:3px; accent-color:var(--accent); }
.catalog-name{ font-weight:700; font-size:13px; }
.catalog-meta{ font-size:11.5px; color:var(--muted); }
.catalog-actions{ display:flex; gap:6px; align-items:center; }

.check-row{ display:flex; align-items:flex-start; gap:8px; padding:6px 0; }
.check-row label{ font-size:12.5px; font-weight:600; cursor:pointer; }
.check-row .field-note{ margin-left:22px; margin-top:-2px; }
.check-row input[type=checkbox]{ margin-top:3px; accent-color:var(--accent); }
.check-row input[disabled] ~ label{ opacity:0.55; cursor:not-allowed; }

.mol-box{ background:transparent; border:1px solid var(--line); border-radius:8px; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.mol-box svg{ width:100%; height:100%; }
.qmol{ display:flex; gap:16px; align-items:flex-start; }
.qmol .mol-box{ width:150px; height:150px; flex:none; cursor:pointer; }
.qmol .mol-box:hover{ border-color:var(--accent); }
.qmol-fields{ flex:1; min-width:0; }

table{ width:100%; border-collapse:collapse; font-size:12.5px; }
thead th{
  text-align:left; font-size:10.5px; text-transform:uppercase; letter-spacing:0.04em; color:var(--muted);
  font-weight:700; padding:8px; border-bottom:1px solid var(--line); white-space:nowrap; background:var(--panel);
}
tbody td{ padding:8px; border-bottom:1px solid var(--line); vertical-align:middle; }
tbody tr:last-child td{ border-bottom:none; }
tbody tr:hover{ background:var(--panel); }
.table-wrap{ overflow-x:auto; }
.table-scroll{ max-height:46vh; overflow:auto; border:1px solid var(--line); border-radius:8px; }
.table-scroll thead th{ position:sticky; top:0; z-index:1; }
.row-actions{ display:flex; gap:6px; }
.row-actions .btn{ height:28px; min-height:28px; padding:0 10px; font-size:11.5px; white-space:nowrap; }

.stat-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.stat{ background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:10px 12px; min-width:0; overflow:hidden; }
.stat .st-label{ font-size:11px; color:var(--muted); font-weight:600; }
.stat .st-value{ font-size:20px; font-weight:700; margin-top:2px; }
.progress-track{ width:100%; height:10px; border-radius:6px; background:var(--panel); border:1px solid var(--line); overflow:hidden; margin:10px 0 6px; }
.progress-fill{ height:100%; background:var(--accent); width:0%; transition:width .5s ease; }
.progress-caption{ display:flex; justify-content:space-between; font-size:11.5px; color:var(--muted); }

.tooltip{
  position:fixed; pointer-events:none; background:var(--border); color:var(--bg);
  padding:7px 9px; border-radius:6px; font-size:11.5px; line-height:1.4; box-shadow:0 4px 14px var(--shadow);
  opacity:0; transform:translateY(2px); transition:opacity .1s, transform .1s; z-index:50; max-width:220px;
}
.tooltip.show{ opacity:1; transform:translateY(0); }
.tooltip .tt-strong{ font-weight:700; font-variant-numeric:tabular-nums; }
.tooltip .tt-sub{ opacity:0.8; }
.tooltip .tt-mol{ background:#fff; border-radius:4px; padding:3px; margin-bottom:5px; width:120px; height:90px; display:flex; align-items:center; justify-content:center; }
.tooltip .tt-mol svg{ width:100%; height:100%; }

/* ---- help icon + floating movable info panel ---- */
.help-icon{
  display:inline-flex; align-items:center; justify-content:center; width:17px; height:17px;
  border-radius:50%; border:1px solid var(--line); background:var(--panel); color:var(--muted);
  font-size:11px; font-weight:700; cursor:pointer; flex:none; font-family:inherit; padding:0; line-height:1;
}
.help-icon:hover{ border-color:var(--accent); color:var(--accent); }
.link-btn{ background:none; border:none; padding:0; margin:0; color:var(--accent); font:inherit; font-size:inherit; text-decoration:underline; cursor:pointer; }
.link-btn:hover{ color:var(--accent-dark); }
.float-panel{
  position:fixed; z-index:200; width:340px; max-width:90vw; background:var(--bg); border:1px solid var(--line);
  border-radius:10px; box-shadow:0 16px 44px var(--shadow); display:none; flex-direction:column; max-height:70vh;
}
.float-panel.open{ display:flex; }
.float-panel-head{
  display:flex; align-items:center; gap:8px; padding:9px 10px 9px 14px; border-bottom:1px solid var(--line);
  cursor:grab; user-select:none; border-radius:10px 10px 0 0; background:var(--panel);
}
.float-panel-head:active{ cursor:grabbing; }
.float-panel-title{ font-weight:700; font-size:13px; flex:1; }
.float-panel-close{ border:none; background:transparent; color:var(--muted); cursor:pointer; font-size:16px; line-height:1; padding:2px 4px; }
.float-panel-close:hover{ color:var(--crit-text); }
.float-panel-body{ padding:12px 14px; font-size:12.5px; line-height:1.55; overflow-y:auto; }
.float-panel-body p{ margin:0 0 8px; }
.float-panel-body p:last-child{ margin-bottom:0; }
.float-panel-body dt{ font-weight:700; margin-top:8px; }
.float-panel-body dt:first-child{ margin-top:0; }
.float-panel-body dd{ margin:2px 0 0; color:var(--muted); }

/* ---- modals + drawers (shared shell: centered modal, or right-anchored
   inspector drawer — same backdrop/open idiom, different anchoring) ---- */
.modal-backdrop{
  position:fixed; inset:0; background:rgba(10,14,13,0.4); display:none; align-items:center; justify-content:center;
  z-index:300; padding:24px;
}
.modal-backdrop.open{ display:flex; }
.modal-panel{
  background:var(--bg); border:1px solid var(--line); border-radius:12px; box-shadow:0 24px 70px var(--shadow);
  max-width:760px; width:100%; max-height:88vh; overflow-y:auto; padding:18px 20px;
}
.modal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.modal-head h2{ margin:0; font-size:17px; }

.wizard-steps{ display:flex; gap:4px; flex-wrap:wrap; margin-bottom:14px; }
.wizard-step-tag{
  font-size:11px; font-weight:700; padding:4px 10px; border-radius:20px; border:1px solid var(--line);
  color:var(--muted); background:var(--panel);
}
.wizard-step-tag.active{ background:var(--accent); border-color:var(--accent); color:#fff; }
.wizard-step-tag.complete{ background:var(--good-bg); border-color:var(--good-border); color:var(--good-text); }
.wizard-body{ display:none; }
.wizard-body.active{ display:block; }
.wizard-nav{ display:flex; justify-content:space-between; margin-top:16px; gap:8px; }

.dropzone{
  border:1.5px dashed var(--line); border-radius:10px; padding:20px; text-align:center; color:var(--muted); font-size:12.5px;
}
.dropzone.drag-over{ border-color:var(--accent); color:var(--accent); background:var(--panel); }
