/* Custom tables editor + list */
.vr-tbl-subtabs{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 10px;padding:0}
.vr-tbl-subtab{
  padding:6px 12px;border:1px solid #334155;border-radius:8px;background:#1a1a1a;color:inherit;
  cursor:pointer;font-weight:600;font-size:13px
}
.vr-tbl-subtab:hover{border-color:#38bdf8}
.vr-tbl-subtab.is-active{
  background:#1d4ed8;border-color:#2563eb;color:#fff;box-shadow:0 0 0 1px rgba(37,99,235,.35)
}
html[data-vr-theme="light"] .vr-tbl-subtab{background:#fff;border-color:#c9d6e8;color:#0f172a}
html[data-vr-theme="light"] .vr-tbl-subtab.is-active{background:#2563eb;border-color:#1d4ed8;color:#fff}
.vr-tbl-subpane[hidden]{display:none!important}
.vr-tbl-wrap{margin-top:8px}
.vr-tbl-list{display:flex;flex-direction:column;gap:8px}
.vr-tbl-card{
  border:1px solid #334155;border-radius:8px;padding:10px 12px;
  background:rgba(15,23,42,.45);display:flex;flex-wrap:wrap;gap:8px;align-items:center
}
html[data-vr-theme="light"] .vr-tbl-card{background:#fff;border-color:#d3deeb}
.vr-tbl-card .vr-tbl-meta{flex:1;min-width:160px}
.vr-tbl-card .vr-tbl-title{font-weight:700}
.vr-tbl-card .vr-tbl-sub{font-size:12px;opacity:.75;margin-top:2px}
.vr-tbl-card .vr-tbl-actions{display:flex;flex-wrap:wrap;gap:6px}

.vr-tbl-modal-backdrop{
  position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:12000;
  display:flex;align-items:center;justify-content:center;padding:12px
}
.vr-tbl-modal{
  width:min(960px,100%);max-height:min(92vh,900px);overflow:auto;
  background:#0f172a;color:#e2e8f0;border:1px solid #334155;border-radius:10px;
  box-shadow:0 18px 50px rgba(0,0,0,.45);padding:14px 16px
}
html[data-vr-theme="light"] .vr-tbl-modal{background:#fff;color:#0f172a;border-color:#c9d6e8}
.vr-tbl-modal h3{margin:0 0 10px 0;font-size:1.1rem}
.vr-tbl-modal .vr-tbl-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:10px}
.vr-tbl-modal label{font-size:12px;opacity:.85}
.vr-tbl-modal input[type="text"],
.vr-tbl-modal input[type="number"]{
  background:#111827;color:#fff;border:1px solid #334155;border-radius:6px;padding:6px 8px
}
html[data-vr-theme="light"] .vr-tbl-modal input[type="text"],
html[data-vr-theme="light"] .vr-tbl-modal input[type="number"]{
  background:#fff;color:#0f172a;border-color:#c9d6e8
}
.vr-tbl-grid-wrap{overflow:auto;margin:8px 0 12px 0;border:1px solid #334155;border-radius:8px}
html[data-vr-theme="light"] .vr-tbl-grid-wrap{border-color:#d3deeb}
.vr-tbl-grid{border-collapse:collapse;min-width:100%;font-size:13px}
.vr-tbl-grid th,.vr-tbl-grid td{border:1px solid #334155;padding:0;vertical-align:top}
html[data-vr-theme="light"] .vr-tbl-grid th,
html[data-vr-theme="light"] .vr-tbl-grid td{border-color:#d3deeb}
.vr-tbl-grid th{background:#1e293b}
html[data-vr-theme="light"] .vr-tbl-grid th{background:#eef3f9}
.vr-tbl-grid input,.vr-tbl-grid textarea{
  width:100%;min-width:90px;box-sizing:border-box;border:0;background:transparent;
  color:inherit;padding:6px 8px;resize:vertical;font:inherit
}
.vr-tbl-grid .vr-tbl-rownum{
  width:36px;text-align:center;opacity:.6;font-size:11px;padding:6px;background:#1e293b
}
html[data-vr-theme="light"] .vr-tbl-grid .vr-tbl-rownum{background:#eef3f9}
.vr-tbl-modal-foot{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;margin-top:8px}
.vr-tbl-empty{opacity:.7;padding:12px 4px}
.vr-tbl-insert-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0}
.vr-tbl-pick-list{display:flex;flex-direction:column;gap:6px;max-height:50vh;overflow:auto}
.vr-tbl-pick-item{
  text-align:left;width:100%;padding:8px 10px;border-radius:8px;
  border:1px solid #334155;background:#111827;color:inherit;cursor:pointer
}
html[data-vr-theme="light"] .vr-tbl-pick-item{background:#f8fafc;border-color:#d3deeb}
.vr-tbl-pick-item:hover{border-color:#38bdf8}
.vr-tbl-pick-card{display:block;padding:10px 12px}
.vr-tbl-pick-head{font-weight:700;margin-bottom:8px}
.vr-tbl-pick-preview{overflow:auto;max-height:220px;pointer-events:none}
.vr-tbl-pick-preview .vr-tbl-preview-table{margin:0}

.vr-tbl-fmtbar{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0 0 10px;padding:8px;border:1px dashed #334155;border-radius:8px}
html[data-vr-theme="light"] .vr-tbl-fmtbar{border-color:#c9d6e8}
.vr-tbl-fmt-lbl{font-size:12px;opacity:.8;margin-right:4px}
.vr-tbl-fmt-hint{font-size:11px;opacity:.55;margin-left:4px}
.vr-tbl-fmt.is-on{outline:2px solid #38bdf8;background:#1e3a5f}
html[data-vr-theme="light"] .vr-tbl-fmt.is-on{background:#dbeafe}
.vr-tbl-cellwrap.is-active{outline:2px solid #38bdf8;outline-offset:-2px}
.vr-tbl-grid input.vr-tbl-h,
.vr-tbl-grid textarea.vr-tbl-cell{min-height:34px}

.vr-tbl-card .vr-tbl-mini{flex:1 1 100%;overflow:auto;margin-top:4px}
.vr-tbl-preview-table,
.vr-art-tbl-preview table{
  border-collapse:collapse;width:100%;font-size:12px;margin:4px 0 8px;background:#0b1220
}
html[data-vr-theme="light"] .vr-tbl-preview-table,
html[data-vr-theme="light"] .vr-art-tbl-preview table{background:#fff}
.vr-tbl-preview-table th,.vr-tbl-preview-table td,
.vr-art-tbl-preview th,.vr-art-tbl-preview td{
  border:1px solid #475569;padding:5px 7px;vertical-align:top
}
html[data-vr-theme="light"] .vr-tbl-preview-table th,
html[data-vr-theme="light"] .vr-tbl-preview-table td,
html[data-vr-theme="light"] .vr-art-tbl-preview th,
html[data-vr-theme="light"] .vr-art-tbl-preview td{border-color:#cbd5e1}
.vr-tbl-preview-table th,.vr-art-tbl-preview th{background:#1e293b}
html[data-vr-theme="light"] .vr-tbl-preview-table th,
html[data-vr-theme="light"] .vr-art-tbl-preview th{background:#eef3f9}
.vr-tbl-title-above{font-weight:700;font-size:12px;margin:0 0 4px 0}
.vr-tbl-preview-table{width:100% !important}

.vr-art-tbl-chips{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 6px;align-items:center}
.vr-art-tbl-chip{display:inline-flex;align-items:center;gap:6px}
.vr-art-tbl-marker{
  display:inline-block;color:#1d4ed8;font-weight:700;font-family:ui-monospace,Consolas,monospace;
  font-size:12px;padding:2px 8px;border-radius:6px;background:rgba(29,78,216,.12);
  border:1px solid rgba(29,78,216,.35)
}
html[data-vr-theme="light"] .vr-art-tbl-marker{
  color:#1e3a8a;background:rgba(30,58,138,.08);border-color:rgba(30,58,138,.3)
}
.vr-art-tbl-edit{padding:2px 8px !important;min-height:0 !important;font-size:12px}
.vr-art-tbl-block{margin:8px 0;padding:8px;border:1px dashed #334155;border-radius:8px}
html[data-vr-theme="light"] .vr-art-tbl-block{border-color:#c9d6e8}
.vr-art-tbl-block-bar{display:flex;justify-content:flex-end;margin-bottom:6px}

.vr-tbl-ctx{
  position:fixed;z-index:14000;min-width:180px;padding:4px;
  background:#0f172a;border:1px solid #334155;border-radius:8px;
  box-shadow:0 12px 28px rgba(0,0,0,.45)
}
html[data-vr-theme="light"] .vr-tbl-ctx{background:#fff;border-color:#c9d6e8}
.vr-tbl-ctx-item{
  display:block;width:100%;text-align:left;border:0;background:transparent;
  color:inherit;padding:8px 10px;border-radius:6px;cursor:pointer;font:inherit
}
.vr-tbl-ctx-item:hover{background:#1e293b}
html[data-vr-theme="light"] .vr-tbl-ctx-item:hover{background:#eef3f9}

.vr-art-tbl-preview-lab{font-size:11px;font-weight:700;opacity:.65;margin:8px 0 4px}
.vr-art-tbl-preview{
  border:1px solid #334155;border-radius:8px;padding:8px 10px;margin-top:2px;
  background:rgba(15,23,42,.35);max-height:280px;overflow:auto
}
html[data-vr-theme="light"] .vr-art-tbl-preview{background:#f8fafc;border-color:#d3deeb}
.vr-art-tbl-text{white-space:pre-wrap;margin:0 0 6px;font-size:13px;line-height:1.4}
.vr-art-tbl-missing{color:#f87171;font-size:12px;margin:6px 0}
.vr-tbl-toast{
  position:fixed;bottom:24px;left:50%;transform:translateX(-50%);z-index:13000;
  background:#0f172a;color:#e2e8f0;border:1px solid #38bdf8;border-radius:8px;
  padding:10px 16px;box-shadow:0 10px 30px rgba(0,0,0,.4);font-size:13px;max-width:90vw
}
html[data-vr-theme="light"] .vr-tbl-toast{background:#fff;color:#0f172a;border-color:#0284c7}
