:root {
  --bg: #121418; --panel: #1c1f26; --panel2: #252932; --line: #323844;
  --text: #e9ebef; --muted: #98a1ae; --accent: #4f8cff;
  --red: #e5484d; --red-bg: rgba(229,72,77,.14); --amber: #f0a020; --amber-bg: rgba(240,160,32,.14);
  --green: #30a46c; --green-bg: rgba(48,164,108,.15);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.4 "Segoe UI", system-ui, -apple-system, Arial, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 16px; }
.tabs { display: flex; gap: 4px; }
.tab { background: none; border: 0; padding: 6px 12px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.tab.active { background: var(--panel2); color: var(--text); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--line);
  font-size: 12px; text-align: center; }
.count.hot { background: var(--red); color: #fff; }
.count.info.new { background: var(--accent); color: #fff; }
.nvr-strip { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--green-bg); color: #7fdcae;
  white-space: nowrap; }
.chip.off { background: var(--red-bg); color: #ff9a9d; }
.right { display: flex; gap: 8px; align-items: center; }
.user { color: var(--muted); }

.btn { border: 1px solid var(--line); background: var(--panel2); padding: 8px 14px; border-radius: 6px;
  cursor: pointer; text-decoration: none; display: inline-block; color: var(--text); }
.btn:hover { border-color: #4a5262; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.take { background: var(--amber); border-color: var(--amber); color: #1a1200; font-weight: 700; }
.btn.real { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn.false { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btn:disabled { opacity: .5; cursor: default; }

.banner { background: var(--amber-bg); color: #ffd28a; padding: 8px 16px; display: flex; gap: 12px;
  align-items: center; }
.banner.warn { background: var(--red-bg); color: #ffb3b5; }
main { padding: 16px; }
.empty { color: var(--muted); padding: 40px; text-align: center; font-size: 16px; }

/* ---------- alarm card ---------- */
#alarms { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 820px), 1fr)); }
.card { background: var(--panel); border-radius: 10px; border-left: 6px solid var(--red);
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr); gap: 14px; padding: 12px; }
.card.noua { animation: pulse 1.2s ease-in-out infinite; }
.card.preluata { border-left-color: var(--amber); }
.card.closing { opacity: .4; transition: opacity .4s; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(229,72,77,0); } 50% { box-shadow: 0 0 0 3px rgba(229,72,77,.55); } }

.media-main { position: relative; background: #000; border-radius: 6px; overflow: hidden; aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center; }
.media-main img, .media-main video { width: 100%; height: 100%; object-fit: contain; display: block; }
.media-main .ph { color: var(--muted); font-size: 13px; }
.media-tabs { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.mtab { font-size: 12px; padding: 3px 8px; border-radius: 4px; background: var(--panel2); border: 1px solid var(--line);
  cursor: pointer; color: var(--muted); }
.mtab.on { color: var(--text); border-color: var(--accent); }
.mtab.wait { cursor: default; font-style: italic; }
.badge { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.65); padding: 2px 8px; border-radius: 4px;
  font-size: 12px; }

.side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.obj { font-size: 26px; font-weight: 700; line-height: 1.15; word-break: break-word; }
.cam { font-size: 16px; }
.tip { color: #ffb3b5; font-weight: 600; }
.when { display: flex; gap: 12px; align-items: baseline; color: var(--muted); }
.timer { font-variant-numeric: tabular-nums; font-size: 18px; color: var(--text); font-weight: 600; }
.info { font-size: 13px; color: var(--muted); background: var(--panel2); border-radius: 6px; padding: 6px 8px; }
.info b { color: var(--text); font-weight: 600; }
.info a.tel { color: inherit; text-decoration: none; }
@media (pointer: coarse) { .info a.tel b { text-decoration: underline; color: #9cc2ff; } }
.proc { white-space: pre-wrap; margin-top: 4px; color: var(--text); }
.meta { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.ok { color: #7fdcae; } .bad { color: #ff9a9d; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.actions .btn { flex: 1; min-width: 90px; padding: 10px; font-size: 15px; }
.form { background: var(--panel2); border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.form h4 { margin: 0; font-size: 14px; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.reason { padding: 4px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel);
  cursor: pointer; font-size: 13px; }
.reason.on { background: var(--green); border-color: var(--green); color: #fff; }
textarea { width: 100%; min-height: 54px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px; resize: vertical; }
.chk { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.form .row { display: flex; gap: 8px; }
.form .row .btn { flex: 1; }
.err { color: #ff9a9d; font-size: 13px; min-height: 1em; }

/* ---------- history ---------- */
.filters { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 12px; }
.filters label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.filters input, .filters select { background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 8px; color-scheme: dark; }
.stats { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.stat { background: var(--panel); border-radius: 8px; padding: 8px 14px; }
.stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); }
table.hist { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 8px; overflow: hidden; }
.hist th, .hist td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.hist th { font-size: 12px; color: var(--muted); font-weight: 600; }
.hist tbody tr { cursor: pointer; }
.hist tbody tr:hover { background: var(--panel2); }
.hist img { width: 96px; height: 54px; object-fit: cover; border-radius: 4px; display: block; background: #000; }
.pill { padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.pill.reala { background: var(--red-bg); color: #ff9a9d; }
.pill.falsa { background: var(--green-bg); color: #7fdcae; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 50; display: flex; align-items: center;
  justify-content: center; padding: 16px; }
.modal-box { background: var(--panel); border-radius: 10px; width: min(1200px, 100%); max-height: 100%; overflow: auto;
  padding: 14px; }
.modal-box .card { border-left-width: 6px; padding: 0; background: none; }
.journal { margin-top: 12px; font-size: 13px; }
.journal td { padding: 2px 10px 2px 0; color: var(--muted); }
.close-x { float: right; }

/* ---------- program ---------- */
.chip.dis { background: rgba(152,161,174,.15); color: #b5bcc6; }
.pill.dezarmat { background: rgba(152,161,174,.15); color: #b5bcc6; }
.prog { background: var(--panel2); border-radius: 8px; padding: 10px; }
.prog .hint { color: var(--muted); font-size: 12px; margin-left: 8px; }
.prow { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.prow .field input[type=time] { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px;
  color: var(--text); color-scheme: dark; }
.pdays { display: flex; gap: 4px; }
.pday { width: 34px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); cursor: pointer;
  color: var(--muted); font-size: 13px; }
.pday.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pquick { display: flex; gap: 4px; }

/* ---------- camere asociate ---------- */
.arow { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.arow select { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; color-scheme: dark; }
.achips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; flex: 1; }
.pday.wide { width: auto; padding: 0 8px; }
.camtabs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.camtab { font-size: 12px; padding: 3px 9px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2);
  cursor: pointer; color: var(--muted); }
.camtab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.camtab.main.on { background: var(--red); border-color: var(--red); }

/* ---------- dispozitive ---------- */
.dev { background: var(--panel2); border-radius: 8px; padding: 10px; margin-bottom: 8px; border-left: 3px solid var(--accent); }
.devhead { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.devline { font-size: 13px; padding: 1px 0; white-space: nowrap; }

/* ---------- jurnal ---------- */
.sysinfo { display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; background: var(--panel);
  border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.sysinfo b { color: var(--text); font-weight: 600; }
.sysinfo .btn { margin-left: auto; }
.logbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.logbar input#log-q { flex: 1; min-width: 200px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 8px; }
.logbar select { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 5px; color-scheme: dark; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.segb { background: var(--panel); border: 0; padding: 6px 12px; cursor: pointer; color: var(--muted); }
.segb.on { background: var(--accent); color: #fff; }
.logbox { background: #0b0d10; border: 1px solid var(--line); border-radius: 8px; height: calc(100vh - 260px);
  min-height: 300px; overflow: auto; font: 12.5px/1.45 Consolas, "Cascadia Mono", ui-monospace, monospace;
  padding: 8px 10px; white-space: pre-wrap; word-break: break-word; }
.logbox .l { padding: 1px 0; }
.logbox .l.alarm { color: #ff8a8d; }
.logbox .l.err { color: #f5b452; }
.logbox .l.ok { color: #7fdcae; }
.logbox .l.sep { color: #6b7380; }
.logbox table { width: 100%; border-collapse: collapse; font-family: inherit; }
.logbox td { padding: 2px 8px 2px 0; vertical-align: top; border-bottom: 1px solid #1a1e25; }
.logbox td:first-child { white-space: nowrap; color: var(--muted); }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(10,12,16,.92); display: flex;
  align-items: center; justify-content: center; padding: 16px; }
.overlay.gate { cursor: pointer; background: rgba(120,20,24,.88); }
.gate-box { text-align: center; }
.gate-title { font-size: 30px; font-weight: 700; }
.gate-sub { margin-top: 10px; font-size: 16px; color: #ffd0d2; }

/* ---------- login ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login { background: var(--panel); padding: 24px; border-radius: 10px; width: min(340px, 100%);
  display: flex; flex-direction: column; gap: 12px; }
.login h1 { margin: 0 0 4px; font-size: 20px; }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.login input { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 8px; }

/* ---------- admin ---------- */
.subtabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.subtab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; cursor: pointer;
  color: var(--muted); }
.subtab.active { color: var(--text); border-bottom-color: var(--accent); }
.toolbar { margin-bottom: 10px; }
table.adm tbody tr { cursor: default; }
table.adm td .btn { margin-right: 4px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 14px; }
.fgrid .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.field input[type=text], .field input[type=number], .field input[type=password], .field select, .field textarea {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; color: var(--text);
  font-size: 14px; color-scheme: dark; }
.field.bool { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; padding-top: 16px; }
.field .multi { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text); font-size: 14px; }
.field .multi label { display: flex; gap: 5px; align-items: center; }
.fsec { background: var(--panel); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.fsec h3 { margin: 0 0 4px; font-size: 16px; }
.fsec .hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.fsec .foot { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.fsec .foot input { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
.msg { font-size: 13px; }
.msg.ok { color: #7fdcae; } .msg.bad { color: #ff9a9d; }
.steps { font-size: 13px; margin-top: 8px; }
.steps div { padding: 2px 0; }
.modal-box h2 { margin: 0 0 12px; font-size: 18px; }
.modal-box h4 { margin: 14px 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- telefon / tabletă ---------- */
.nvr-sum { display: none; }
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.top { padding-top: max(8px, env(safe-area-inset-top)); }
@media (pointer: coarse) {
  .btn.small { padding: 8px 12px; }
  .mtab, .camtab { padding: 7px 12px; font-size: 13px; }
  .reason { padding: 8px 14px; font-size: 14px; }
  .pday { width: 40px; height: 38px; }
  .hist tbody tr:hover { background: none; }
}
@media (max-width: 900px) {
  .card { grid-template-columns: minmax(0, 1fr); }
  .obj { font-size: 22px; }
  .hist th:nth-child(7), .hist td:nth-child(7) { display: none; }
  .logbox { height: calc(100vh - 320px); }
}
@media (max-width: 1100px) {
  /* lista de obiective conectate se strânge într-un buton (se deschide la apăsare) */
  .nvr-sum { display: inline-block; font-size: 12px; padding: 5px 10px; border-radius: 12px; border: 0;
    background: var(--green-bg); color: #7fdcae; cursor: pointer; margin-left: auto; }
  .nvr-sum.off { background: var(--red-bg); color: #ff9a9d; font-weight: 600; }
  .nvr-strip { display: none; order: 4; width: 100%; flex: none; max-height: 40vh; overflow: auto; padding: 4px 0; }
  .nvr-strip.open { display: flex; }
}
@media (max-width: 700px) {
  html, body { font-size: 15px; }
  main { padding: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  /* bara de sus: rândul 1 = nume + butoane, rândul 2 = tab-uri; lista de NVR-uri se deschide la apăsare */
  .top { gap: 6px 8px; padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top)); }
  .brand { font-size: 15px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .right { gap: 6px; order: 2; }
  #user { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block;
    vertical-align: bottom; }
  .tabs { order: 3; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { flex: 1; padding: 9px 8px; white-space: nowrap; }
  .nvr-sum { order: 1; margin-left: 0; }
  .banner { padding: 8px 10px; flex-wrap: wrap; font-size: 14px; }
  /* cardul de alarmă */
  #alarms { gap: 10px; }
  .card { padding: 8px; gap: 8px; border-left-width: 5px; grid-template-columns: minmax(0, 1fr); }
  .card > *, .media-wrap, .side { min-width: 0; }
  .obj { font-size: 21px; }
  .cam { font-size: 15px; }
  .when { flex-wrap: wrap; gap: 4px 12px; }
  .actions { position: sticky; bottom: 0; background: var(--panel); padding: 6px 0 2px; z-index: 2; }
  .actions .btn { padding: 14px 8px; font-size: 16px; min-width: 0; }
  .actions .btn.take { flex-basis: 100%; font-size: 18px; padding: 16px; }
  .form .row { flex-direction: column; }
  .form .row .btn { padding: 12px; font-size: 15px; }
  .media-tabs, .camtabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .mtab, .camtab { white-space: nowrap; flex: none; }
  /* istoric și tabelele de administrare devin carduri */
  .filters { gap: 8px; }
  .filters label { flex: 1 1 140px; }
  .filters input, .filters select { padding: 8px; font-size: 16px; }
  .stat { flex: 1 1 40%; padding: 6px 10px; }
  .stat .v { font-size: 18px; }
  table.hist, .hist tbody, .hist tr, .hist td { display: block; width: 100%; }
  table.hist { background: none; }
  .hist thead { display: none; }
  .hist tbody tr { background: var(--panel); border-radius: 8px; margin-bottom: 8px; padding: 8px 10px; position: relative; }
  .hist td { border: 0; padding: 2px 0; }
  .hist td[data-l]:not([data-l=""])::before { content: attr(data-l) ": "; color: var(--muted); font-size: 12px; }
  .hist th:nth-child(7), .hist td:nth-child(7) { display: block; }
  .hist td:empty { display: none; }
  .hist img { width: 100%; height: auto; aspect-ratio: 16/9; margin-bottom: 4px; }
  table.adm td .btn { margin: 4px 4px 0 0; }
  .devline { white-space: normal; }
  /* ferestrele (modal) ocupă tot ecranul */
  .modal { padding: 0; align-items: stretch; }
  .modal-box { width: 100%; max-height: none; height: 100%; border-radius: 0; padding: 10px;
    padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .close-x { position: sticky; top: 0; z-index: 3; }
  .fgrid { grid-template-columns: 1fr; }
  .field input[type=text], .field input[type=number], .field input[type=password], .field select, .field textarea,
  .login input, textarea, .prow input[type=time], .arow select, .logbar input#log-q, .logbar select { font-size: 16px; }
  .prow, .arow { gap: 8px; }
  .subtabs { overflow-x: auto; }
  .subtab { white-space: nowrap; }
  .sysinfo .btn { margin-left: 0; }
  .logbox { height: 60vh; font-size: 11.5px; }
  .gate-title { font-size: 24px; }
}

/* ---------- contul meu / 2FA ---------- */
.acc { display: flex; gap: 12px 20px; justify-content: space-between; align-items: center; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--line); }
.acc > div:first-child { flex: 1 1 260px; }
.acc .hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
.qr { display: flex; justify-content: center; margin: 10px 0; }
.qr svg { width: 220px; height: 220px; background: #fff; border-radius: 8px; padding: 6px; }
.steps-list { margin: 0 0 6px; padding-left: 20px; color: var(--muted); font-size: 13px; }
.steps-list li { margin: 3px 0; }
code.sel { user-select: all; color: var(--text); background: var(--panel2); padding: 2px 6px; border-radius: 4px; }
#login-cod-wrap input { letter-spacing: .3em; font-size: 20px; text-align: center; }

/* ---------- LPR (treceri vehicule) ---------- */
.lpr-list { display: flex; flex-direction: column; gap: 8px; }
.lpr { display: grid; grid-template-columns: 200px 160px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  background: var(--panel); border-radius: 8px; padding: 8px 12px; border-left: 4px solid var(--accent); cursor: pointer; }
.lpr.fresh { animation: lprflash 2.5s ease-out; }
@keyframes lprflash { from { background: rgba(79,140,255,.28); } to { background: var(--panel); } }
.lpr .scena { width: 200px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; background: #000; display: block; }
.lpr .crop { width: 160px; height: 44px; object-fit: contain; background: #000; border-radius: 4px; display: block; }
.placuta { display: inline-flex; align-items: center; gap: 6px; background: #f4f4f0; color: #111; border: 2px solid #222;
  border-radius: 5px; padding: 1px 10px 1px 0; font: 700 20px/1.3 "Segoe UI", Arial, sans-serif; letter-spacing: .06em;
  white-space: nowrap; }
.placuta::before { content: attr(data-t); background: #1f4fb5; color: #ffd43b; font-size: 10px; letter-spacing: 0; padding: 7px 4px;
  border-radius: 3px 0 0 3px; align-self: stretch; display: flex; align-items: flex-end; }
.placuta.necitit { color: #888; font-size: 15px; }
.lpr .det { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lpr .det b { color: var(--text); font-weight: 600; }
.lpr .ora { font-variant-numeric: tabular-nums; color: var(--text); font-size: 15px; text-align: right; white-space: nowrap; }
.lpr-big { width: 100%; border-radius: 6px; background: #000; display: block; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; }
.toast { background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px;
  padding: 8px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.4); display: flex; gap: 10px; align-items: center;
  pointer-events: auto; cursor: pointer; animation: toastin .25s ease-out; max-width: 420px; }
.toast .t2 { font-size: 12px; color: var(--muted); }
.toast.out { opacity: 0; transition: opacity .4s; }
@keyframes toastin { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 900px) {
  .lpr { grid-template-columns: 120px minmax(0, 1fr); grid-template-areas: "scena det" "scena ora"; }
  .lpr .scena { width: 120px; grid-area: scena; }
  .lpr .cropw { display: none; }
  .lpr .det { grid-area: det; }
  .lpr .ora { grid-area: ora; text-align: left; font-size: 13px; color: var(--muted); }
  .lpr { align-items: start; }
  .lpr-modal { grid-template-columns: minmax(0, 1fr) !important; }
  .toasts { left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
}

/* ---------- LPR: mesaj fix în Active + liste ---------- */
#lpr-pinned { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
#lpr-pinned:empty { display: none; }
.pin { display: flex; gap: 12px; align-items: center; background: var(--panel); border-radius: 8px; padding: 6px 10px;
  border-left: 5px solid var(--accent); cursor: pointer; animation: lprflash 2.5s ease-out; }
.pin.whitelist { border-left-color: var(--green); }
.pin.necunoscut { border-left-color: var(--amber); background: linear-gradient(90deg, var(--amber-bg), var(--panel) 60%); }
.pin.blacklist { border-left-color: var(--red); background: linear-gradient(90deg, var(--red-bg), var(--panel) 60%); }
.pin-img { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; background: #000; flex: none; }
.pin-crop { width: 130px; height: 38px; object-fit: contain; background: #000; border-radius: 4px; flex: none; }
.pin-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); }
.pin-txt b { color: var(--text); }
.pin-txt .placuta { font-size: 17px; }
.pin-ok { flex: none; padding: 10px 14px; font-weight: 600; }
.lbadge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 4px;
  vertical-align: middle; }
.lbadge.whitelist { background: var(--green-bg); color: #7fdcae; }
.lbadge.necunoscut { background: var(--amber-bg); color: #ffd28a; }
.lbadge.blacklist { background: var(--red); color: #fff; }
.ldesc { font-size: 12px; color: var(--muted); vertical-align: middle; }
@media (max-width: 700px) {
  .pin { flex-wrap: wrap; gap: 8px; }
  .pin-img { width: 96px; }
  .pin-crop { display: none; }
  .pin-txt { flex: 1 1 160px; }
  .pin-ok { flex: 1 1 100%; padding: 12px; font-size: 15px; }
}

/* ================= Cântar Auto ================= */
.scales { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 620px), 1fr)); }
.scale { background: var(--panel); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.scale-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.scale-head h2 { margin: 0; font-size: 20px; flex: 1; }
.scale-live { font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 700; color: #9cc2ff; }
.veh { border-radius: 8px; background: var(--panel2); padding: 10px; border-left: 5px solid var(--accent);
  display: flex; flex-direction: column; gap: 8px; animation: lprflash 2.5s ease-out; }
.veh.open { border-left-color: var(--amber); }
.veh-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.veh-top .placuta { font-size: 24px; }
.veh-info { color: var(--muted); font-size: 13px; flex: 1; min-width: 150px; }
.veh-info b { color: var(--text); }
.veh-open { background: var(--amber-bg); color: #ffd28a; border-radius: 6px; padding: 6px 10px; font-size: 13px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.thumbs figure { margin: 0; cursor: zoom-in; }
.thumbs img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; display: block; background: #000; }
.thumbs figcaption { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.thumbs .wait { aspect-ratio: 16/9; border-radius: 4px; background: #000; display: flex; align-items: center;
  justify-content: center; color: var(--muted); font-size: 12px; }
.veh-act { display: flex; gap: 8px; flex-wrap: wrap; }
.veh-act .btn { flex: 1; min-width: 140px; padding: 11px; font-size: 15px; font-weight: 600; }
.scale-empty { color: var(--muted); font-size: 14px; padding: 18px; text-align: center; background: var(--panel2);
  border-radius: 8px; }
h3.sec { font-size: 15px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.open-list { display: flex; flex-direction: column; gap: 6px; }
.orow { display: flex; gap: 12px; align-items: center; background: var(--panel); border-radius: 8px; padding: 8px 12px;
  flex-wrap: wrap; border-left: 4px solid var(--amber); }
.orow .placuta { font-size: 17px; }
.orow .t { flex: 1; min-width: 180px; font-size: 13px; color: var(--muted); }
.orow .t b { color: var(--text); }
/* formular cântărire */
.wform { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); gap: 16px; }
.wform .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wbig { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; background: var(--panel2); border-radius: 8px; padding: 10px; }
.wbig label { flex: 1; min-width: 160px; }
.wbig input { font-size: 26px !important; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.wcalc { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.wcalc div { background: var(--panel2); border-radius: 6px; padding: 6px 12px; text-align: right; min-width: 110px; }
.wcalc span { display: block; font-size: 11px; color: var(--muted); }
.wcalc b { font-size: 18px; font-variant-numeric: tabular-nums; }
.wcalc .net b { color: #7fdcae; font-size: 22px; }
.seg2 { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg2 button { background: var(--panel); border: 0; padding: 8px 14px; cursor: pointer; color: var(--muted); }
.seg2 button.on { background: var(--accent); color: #fff; }
.prev1 { background: var(--panel2); border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--muted); }
.prev1 b { color: var(--text); }
.pill.deschisa { background: var(--amber-bg); color: #ffd28a; }
.pill.finalizata { background: var(--green-bg); color: #7fdcae; }
.pill.anulata { background: var(--red-bg); color: #ff9a9d; }
.kgcol { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zoom { position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,.92); display: flex; align-items: center;
  justify-content: center; cursor: zoom-out; padding: 10px; }
.zoom img { max-width: 100%; max-height: 100%; }
.cam-row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-bottom: 6px; }
.cam-row select, .cam-row input { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px;
  color: var(--text); color-scheme: dark; }
.cam-row select { flex: 2; min-width: 220px; }
.cam-row input { flex: 1; min-width: 140px; }
@media (max-width: 900px) {
  .wform { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .wform .fgrid { grid-template-columns: minmax(0, 1fr); }
  .thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ================= Temă verde deschis (Cântar Auto) ================= */
:root {
  --bg: #eef6ee; --panel: #ffffff; --panel2: #f3f8f2; --line: #cfe1cd;
  --text: #1d2b1f; --muted: #5d7262; --accent: #2e9a4f;
  --red: #d9363e; --red-bg: rgba(217,54,62,.10); --amber: #e08a00; --amber-bg: rgba(224,138,0,.12);
  --green: #2e9a4f; --green-bg: rgba(46,154,79,.12);
  color-scheme: light;
}
html, body { background: var(--bg); color: var(--text); }
.top { background: #ffffff; border-bottom: 1px solid var(--line); box-shadow: 0 1px 4px rgba(30,70,40,.06); }
.brand { color: #1f7a3d; }
.tab.active { background: var(--green-bg); color: #1f6e37; font-weight: 600; }
.btn { background: #ffffff; border-color: var(--line); color: var(--text); }
.btn:hover { border-color: #9cc59f; background: #f6fbf5; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #278744; }
.btn.ghost { background: transparent; }
.btn.real { background: var(--red); border-color: var(--red); color: #fff; }
.chip { background: var(--green-bg); color: #1f6e37; }
.chip.off { background: var(--red-bg); color: #b3262d; }
.nvr-sum { background: var(--green-bg); color: #1f6e37; }
.nvr-sum.off { background: var(--red-bg); color: #b3262d; }
.banner { background: var(--amber-bg); color: #8a5300; }
.banner.warn { background: var(--red-bg); color: #9e2228; }
.scale, .orow, .stat, table.hist, .fsec, .sysinfo, .dev, .modal-box, .login { box-shadow: 0 1px 3px rgba(30,70,40,.08); }
.scale { border: 1px solid var(--line); }
.veh { background: #f7fbf6; border: 1px solid var(--line); border-left: 5px solid var(--accent); }
.veh.open { border-left-color: var(--amber); }
.veh-open { background: #fff4dc; color: #7a4a00; }
.scale-live { color: #1f7a3d; }
.thumbs img, .thumbs .wait { background: #dfe9de; }
.thumbs .wait { color: var(--muted); }
.wbig, .wcalc div, .prev1 { background: var(--panel2); border: 1px solid var(--line); }
.wcalc .net b { color: #1f7a3d; }
.seg2 button { background: #fff; }
.seg2 button.on { background: var(--accent); color: #fff; }
.field input[type=text], .field input[type=number], .field input[type=password], .field select, .field textarea,
.filters input, .filters select, .login input, .cam-row select, .cam-row input, .logbar input#log-q, .logbar select, textarea {
  background: #fff; border-color: #bcd5ba; color: var(--text); color-scheme: light; }
.field input:focus, .field select:focus, .field textarea:focus, .filters input:focus, textarea:focus { outline: 2px solid rgba(46,154,79,.35); border-color: var(--accent); }
.hist th { color: var(--muted); background: #f3f8f2; }
.hist tbody tr:hover { background: #f3f9f1; }
.pill.deschisa { background: #fff1d6; color: #8a5300; }
.pill.finalizata { background: var(--green-bg); color: #1f6e37; }
.pill.anulata { background: var(--red-bg); color: #b3262d; }
.ok, .msg.ok { color: #1f7a3d; } .bad, .msg.bad, .err { color: #c0282f; }
.logbox { background: #fbfdfb; border-color: var(--line); color: var(--text); }
.logbox .l.err { color: #b46a00; } .logbox .l.ok { color: #1f7a3d; } .logbox td { border-bottom-color: #e6efe5; }
.modal { background: rgba(30,50,35,.45); }
.overlay { background: rgba(225,240,226,.96); }
.subtab.active { border-bottom-color: var(--accent); color: var(--text); }
.segb { background: #fff; } .segb.on { background: var(--accent); color: #fff; }
.placuta { border-color: #333; }
.zoom { background: rgba(15,30,18,.9); }
.scale-empty { background: var(--panel2); border: 1px dashed var(--line); }
h3.sec { color: #4d6a53; }

/* totaluri pe material */
.totw { margin-bottom: 14px; }
.toth { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
table.tot tbody tr { cursor: pointer; }
table.tot tr.sel td { background: var(--green-bg); }
table.tot tr.totrow td { font-weight: 700; border-top: 2px solid var(--line); background: var(--panel2); cursor: default; }

.kgcol.neg, td.neg { color: #b3262d; }
.kgcol.pos { color: #1f7a3d; }
td .t2, td.t2 { font-size: 11.5px; color: var(--muted); }

/* listă de alegere (produs, client, transportator...) */
.combo { position: fixed; z-index: 200; background: #fff; border: 1px solid #9cc59f; border-radius: 6px;
  box-shadow: 0 6px 18px rgba(30,70,40,.18); max-height: 260px; overflow: auto; font-size: 14px; }
.combo .ci { padding: 7px 10px; cursor: pointer; color: var(--text); }
.combo .ci:hover, .combo .ci.on { background: var(--green-bg); }
.combo .cnew { padding: 7px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); background: #f8fbf7; }
input[data-combo] { background-image: linear-gradient(45deg, transparent 50%, #5d7262 50%), linear-gradient(135deg, #5d7262 50%, transparent 50%) !important;
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52% !important; background-size: 5px 5px, 5px 5px !important;
  background-repeat: no-repeat !important; padding-right: 26px !important; }

.placuta.nec::before { background: #777; color: #fff; }

/* v0.2: versiune, probleme, ieșiri, liste vehicule, stare camere */
.brand .ver { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 6px; }
#probleme { margin-bottom: 10px; }
.prob { background: #fdecec; border: 1px solid #e8a3a6; border-left: 5px solid #d9363e; border-radius: 8px; padding: 8px 12px;
  display: flex; gap: 12px; align-items: flex-start; color: #6d1116; }
.prob ul { margin: 0; padding-left: 18px; flex: 1; } .prob li.galben { color: #7a4d00; }
.tab.warn { box-shadow: inset 0 -3px 0 #d9363e; }
.outs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; }
.btn.out { background: #fff6d6; border-color: #e0b400; color: #6a4e00; font-weight: 600; }
.btn.out.on { background: #2f9e5b; border-color: #2f9e5b; color: #fff; }
.lbadge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.lbadge.autorizat { background: #dff3e7; color: #1d7a4f; } .lbadge.necunoscut { background: #fff1d6; color: #8a5a00; }
.lbadge.interzis { background: #d9363e; color: #fff; }
.ldesc { font-size: 12px; color: var(--muted); }
.veh.interzis { outline: 3px solid #d9363e; background: #fdecec; }
.stare-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.scard { background: var(--panel); border-radius: 10px; padding: 10px 12px; border-top: 3px solid #2f9e5b; box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.scard.sbadc { border-top-color: #d9363e; }
.scard .sh { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 15px; }
.srow { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.srow span { color: var(--muted); } .srow b { text-align: right; }
.srow.sok b { color: #1d7a4f; } .srow.swarn b { color: #a86200; } .srow.sbad b { color: #c0262d; }
.sdet { font-size: 12px; color: var(--muted); padding: 2px 0 4px; } .sdet.bad { color: #c0262d; }
.dot-on, .dot-off { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dot-on { background: #2f9e5b; } .dot-off { background: #d9363e; }
.orow-o { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; padding: 4px 0; }

.vlist { display: flex; flex-direction: column; gap: 8px; max-width: 900px; }
.vrow { background: var(--panel); border-radius: 8px; padding: 8px 12px; border-left: 3px solid var(--line); }
.vrow.cur { border-left-color: #2f9e5b; }
.vh { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; } .vh span { color: var(--muted); font-size: 12px; } .vh .vi { margin-left: auto; }
.vrow ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }

.orow.fara { gap: 10px; }
.fara-img { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; background: var(--panel2, #e8efe8); flex: none; cursor: zoom-in; }

.live-wrap { display: grid; gap: 8px; }
.live-wrap.two { grid-template-columns: 1fr 1fr; }
.live { margin: 0; position: relative; background: #111; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; }
.live img { width: 100%; height: 100%; object-fit: contain; display: block; }
.live-ph { color: #aaa; font-size: 13px; display: flex; align-items: center; justify-content: center; height: 100%; padding: 10px; text-align: center; }
.live figcaption { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 4px; letter-spacing: .04em; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e53935; margin-right: 6px; animation: livep 1.4s infinite; }
@keyframes livep { 50% { opacity: .3; } }
.live-hint { color: var(--muted); font-size: 12px; text-align: center; margin-top: 6px; }

.afis-box { margin-top: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; background: var(--panel2); }
.afis-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.afis-top b { flex: 1; }
.afis-st { margin-top: 6px; font-size: 14px; }
.afis-st.ok b { font-size: 20px; color: var(--ok, #2e7d32); }
.afis-st.bad { color: #b26a00; }
#w-afis-img { margin-top: 6px; max-width: 100%; height: 60px; object-fit: contain; image-rendering: pixelated; border-radius: 4px; }

.live-extra { display: grid; gap: 8px; margin-top: 10px; grid-template-columns: repeat(3, 1fr); }
.live-extra.n1 { grid-template-columns: 1fr; }
.live-extra.n2 { grid-template-columns: 1fr 1fr; }
.live.small figcaption { font-size: 10px; padding: 2px 6px; }
.live-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.live-row select, .live-row input { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; color: var(--text); }
.live-row select { flex: 2; min-width: 220px; }
.live-row input { flex: 2; min-width: 180px; }
@media (max-width: 700px) { .live-extra { grid-template-columns: 1fr 1fr; } }

.afis-live { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; padding: 8px 12px;
  border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); cursor: pointer; }
.afis-live.stabil { border-color: #2e7d32; background: rgba(46,125,50,.08); }
.afl-t { font-size: 12px; font-weight: 700; color: var(--muted); }
.afl-v { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.afl-s { font-size: 12px; color: var(--muted); }
.afl-s.ok { color: #2e7d32; }
.afl-s.wait { color: #b26a00; }
.afl-s code { font-size: 12px; background: rgba(0,0,0,.06); padding: 0 4px; border-radius: 3px; }
.afl-zona { margin: -4px 0 10px; }
.afl-zona img { max-width: 100%; height: 70px; object-fit: contain; image-rendering: pixelated; border-radius: 6px; background: #222; }

.veh-kg { margin: 6px 0; padding: 6px 10px; border-radius: 6px; background: rgba(46,125,50,.1); font-size: 15px; }
.veh-kg b { font-size: 18px; }
.veh-kg span { color: var(--muted); font-size: 12px; }

.mchk { position: relative; display: inline-block; }
.mchk-btn { min-width: 170px; text-align: left; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); cursor: pointer; font: inherit; }
.mchk-list { position: absolute; z-index: 20; top: 100%; left: 0; min-width: 220px; margin-top: 4px; padding: 8px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.mchk .mchk-list label { display: flex !important; flex-direction: row !important; margin: 0; gap: 8px; align-items: center; padding: 4px 2px; font-size: 14px; color: var(--text); white-space: nowrap; }
#stoc-wrap .totw { margin-bottom: 14px; }

.mchk .mchk-list input[type=checkbox] { width: auto !important; min-width: 0; margin: 0; flex: none; }

.logo-top { height: 34px; max-width: 160px; object-fit: contain; background: #fff; border-radius: 6px; padding: 3px; margin-right: 10px; }
.logo-login { max-height: 90px; max-width: 240px; object-fit: contain; align-self: center; margin-bottom: 4px; background: #fff; border-radius: 8px; padding: 6px; }
.logo-prev { max-height: 80px; max-width: 260px; background: #fff; padding: 8px; border-radius: 6px; border: 1px solid var(--line); }

/* banda de numere de sus (ecranul Cântar): o linie pe cântar, cele mai noi în stânga */
#banda { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
#banda .brow { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; min-width: 0; }
#banda .bname { flex: none; width: 130px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#banda .blist { flex: 1; min-width: 0; display: flex; gap: 8px; overflow: hidden; white-space: nowrap; align-items: center; }
#banda .bchip { flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 2px 4px; border-radius: 6px; }
#banda .bchip .placuta { font-size: 15px; }
#banda .bchip small { font-size: 11px; color: var(--muted); }
#banda .bchip.interzis { background: rgba(220, 40, 40, .18); }
#banda .bchip.interzis small { color: #d33; font-weight: 700; }
#banda .bchip.autorizat small { color: #2b9a4a; }
#banda .bchip:first-child .placuta { box-shadow: 0 0 0 2px rgba(43, 154, 74, .55); }
@media (max-width: 700px) { #banda .bname { width: 80px; font-size: 12px; } }

/* alegerea camerei cu căutare */
#campick { position: fixed; z-index: 1000; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 8px;
  background: var(--panel, #fff); color: var(--text, #111); border: 1px solid #6d95ff; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
#campick input { padding: 7px 9px; border-radius: 6px; border: 1px solid var(--line, #ccd); background: var(--panel2, #fff); color: inherit; font: inherit; }
#cp-list { overflow: auto; flex: 1; min-height: 60px; }
.cp-i { padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.cp-i:hover { background: rgba(109,149,255,.15); }
.cp-i.on { background: #2d5bd1; color: #fff; }
.cp-i.cur { box-shadow: inset 3px 0 0 #2bb39a; }

/* modul ▶ Video */
.live-mode { position: absolute; right: 6px; top: 6px; z-index: 3; font-size: 11px; padding: 2px 8px; border-radius: 10px; cursor: pointer;
  background: rgba(10,20,40,.8); color: #dfe7f3; border: 1px solid #3a5a8a; opacity: .6; }
.live-mode:hover { opacity: 1; }
.live-badge { position: absolute; left: 6px; top: 6px; z-index: 3; font-size: 9px; font-weight: 700; padding: 0 4px; border-radius: 3px; color: #fff; }
.live-badge.video { background: #d32f2f; }
.live-badge.poze, .live-badge.porneste { background: rgba(60,70,90,.85); font-weight: 500; }
/* Video HD (ca în Dispecerat CCTV): fluxul camerei decodat de placa video, peste imagine */
.live { position: relative; }
.live video.hdv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; z-index: 1; }
.live.hd img { visibility: hidden; } .live.hd .live-ph { display: none; }
.live figcaption { z-index: 2; }
.live-badge.hd { background: #d32f2f; }
/* șoferii mașinii (max 4, după număr) – ca în Dispecerat CCTV */
.sof-box { margin-top: 12px; padding: 8px 10px; border: 1px solid var(--line, rgba(127,150,190,.35)); border-radius: 8px; }
.sof-box h4 { margin: 0 0 6px; font-size: 13px; } .sof-box h4 small { font-weight: 400; color: var(--muted); }
.sof-in { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sof-in input { width: 100%; box-sizing: border-box; }
.sof-act { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.sof-msg { font-size: 12px; color: var(--muted); } .sof-msg.ok { color: #2bb37a; } .sof-msg.err { color: #e05050; }
.chip .x { font-weight: 800; }
.live .live-badge { top: auto; bottom: 6px; }

/* administrator / șef (backup): operatorul activ la cântar, agentul de la locație */
.scale-head .prez { font-size: 12px; margin-left: 8px; padding: 2px 8px; border-radius: 10px; }
.scale-head .prez.ok { background: rgba(46, 204, 113, .15); color: #2ecc71; }
.scale-head .prez.bad { background: rgba(243, 156, 18, .15); color: #f39c12; }
.scale-head .chip { margin-left: 6px; }
