:root {
  --bg: #0c1218;
  --panel: #151d26;
  --line: #2a3642;
  --text: #e8eef4;
  --muted: #8fa3b5;
  --accent: #3d9cf0;
  --err: #f87171;
  --ok: #4ade80;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--text); }
.loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 999; background: #1e3a5f; overflow: hidden; }
.loadbar i { display: block; height: 100%; width: 35%; background: var(--accent); animation: slide 1s ease-in-out infinite; }
.loadbar[hidden] { display: none !important; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.wrap { max-width: 1180px; margin: 0 auto; padding: 16px 14px 48px; }
header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
h1 { margin: 4px 0 0; font-size: 22px; }
h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kicker { margin: 0; font-size: 12px; color: var(--muted); }
.status { font-size: 12px; padding: 8px 10px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); max-width: 420px; }
.status.ok { border-color: #166534; color: var(--ok); }
.status.bad { border-color: #7f1d1d; color: var(--err); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.tabs button { border: 0; border-radius: 6px; padding: 8px 12px; background: #243040; color: var(--text); cursor: pointer; font-weight: 600; font-size: 12px; }
.tabs button.on { background: var(--accent); }
.panel { display: none; }
.panel.on { display: block; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.row { flex-wrap: wrap; align-items: end; }
.row label, .row input, .row select, .row button { width: auto; }
.flash { min-height: 1.2em; color: var(--err); font-size: 13px; }
.muted { color: var(--muted); font-size: 12px; }
input, select, textarea, button {
  border: 1px solid var(--line); border-radius: 6px; background: #0f161d; color: var(--text);
  padding: 8px 10px; font: inherit;
}
button { background: var(--accent); border: 0; font-weight: 600; cursor: pointer; }
button.ghost { background: #243040; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.card b { font-size: 20px; }
.table-wrap { overflow: auto; max-height: 52vh; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th, td { border-bottom: 1px solid var(--line); padding: 5px 6px; text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: #1a2430; }
.pager { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin: 8px 0; }
.pager button:disabled { opacity: .4; }
.hits, .list { list-style: none; padding: 0; margin: 0; }
.hits li, .list li { padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.hits li:hover { background: #1a2430; }
.list li { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.chk { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 8px 0; }
.chk input { width: auto; }
pre { background: #0f161d; border: 1px solid var(--line); padding: 10px; border-radius: 8px; overflow: auto; max-height: 40vh; font-size: 11px; }
.edit-box { margin-top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.tabs-main { margin-bottom: 4px; }
.tabs-sub button { background: #1a2430; font-size: 11px; padding: 6px 10px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 12px 0; }
.settings-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.settings-grid .full { grid-column: 1 / -1; }
.settings-grid .btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.entity-list { line-height: 1.6; padding-left: 18px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.filter-bar label { font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.sub-pick { margin: 8px 0; }
.entity-toolbar { margin-bottom: 8px; }
.edit-box textarea, .edit-box input { width: 100%; margin: 6px 0; }
.site-footer { margin-top: 28px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); text-align: center; }
.site-footer a { color: var(--accent); }
.product-meta { margin: 4px 0 0; font-size: 11px; }
.entity-edit { margin-top: 14px; }
.entity-edit-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 12px 0; }
.entity-edit-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.entity-edit-form label.full { grid-column: 1 / -1; }
.entity-edit-form label.readonly input,
.entity-edit-form label.readonly textarea { opacity: 0.75; }
.entity-edit-form .field-hint { font-size: 10px; color: var(--muted); font-weight: normal; }
.entity-edit-lang { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.entity-edit-lang h4 { margin: 0 0 8px; font-size: 13px; }
#entityTable tbody tr { cursor: pointer; }
#entityTable tbody tr:hover { background: #1a2430; }
#entityTable tbody tr.row-on { background: #1e2a38; }
#entityTable th[data-sortable="0"] { cursor: default; opacity: 0.7; }
.db-pick-row { display: flex; gap: 8px; align-items: center; }
.db-pick-row input { flex: 1; }
#dbPick { width: 100%; min-height: 120px; }
.compare-groups { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.compare-group summary { cursor: pointer; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.compare-entity { border-top: 1px solid var(--line); padding: 10px 0; }
.compare-entity-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.compare-entity ul { margin: 4px 0; padding-left: 18px; font-size: 12px; }
.tag-ok { color: var(--ok); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.tag-warn { color: #fbbf24; font-size: 11px; font-weight: 700; }
.tag-err { color: var(--err); font-size: 11px; font-weight: 700; }
#fsDataTable tbody tr { cursor: pointer; }
#fsDataTable tbody tr:hover { background: #1a2430; }
#fsDataTable tbody tr.row-on { background: #1e2a38; }
