/* Стили разделов «Файлы» и «События» */

/* ---- миниатюры событий ---- */
.ev-thumb.ev-none, .feed-thumb.ev-none { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.ev-thumb.ev-none .ico, .feed-thumb.ev-none .ico { width: 18px; height: 18px; opacity: .6; }

/* ---- файлы: загрузка ---- */
.dropzone .ico { width: 28px; height: 28px; margin-bottom: 6px; color: var(--muted); }
.dropzone > div { display: grid; justify-items: center; gap: 2px; }
.dropzone:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fe-opts { margin-top: 12px; }
.fe-opts > summary { cursor: pointer; font-size: 14px; color: var(--text); padding: 4px 0; list-style-position: inside; }
.fe-opts > summary .hint { font-size: 14px; }
.fe-opts[open] > summary { margin-bottom: 10px; }
.fe-opts .groups { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 12px; }
.modal .groups { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.upload-list:empty { display: none; }
.upload-list progress { width: 100%; height: 6px; accent-color: var(--accent); }
.page-head + .card { margin-bottom: 16px; }

/* ---- файлы: таблица ---- */
.fe-name { display: inline-flex; align-items: center; gap: 8px; color: var(--text); max-width: 320px; }
.fe-name .ico { flex: none; width: 16px; height: 16px; color: var(--muted); }
.fe-name:hover { color: #93c5fd; }
.fe-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-status { display: grid; gap: 4px; min-width: 120px; justify-items: start; }
.fe-status .fe-mini { width: 100%; height: 4px; margin: 0; }
.fe-status .fe-mini div { background: var(--warn); }
.fe-err { color: #fca5a5; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.fe-counts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.fe-count { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.fe-actions { display: inline-flex; gap: 2px; }
.fe-actions .btn.icon .ico { width: 16px; height: 16px; }

/* ---- карточка файла ---- */
.page-head .page-actions .btn .ico, .toolbar .btn .ico, .page-head .btn .ico { width: 16px; height: 16px; }
.btn > .ico + * , .btn > .ico { vertical-align: middle; }
.page-title h1 { overflow-wrap: anywhere; }
.viewer .video-wrap video { background: #000; }
.viewer .plates li .plate-text { justify-self: start; font-size: 14px; }

/* ---- журнал событий: фильтры ---- */
.fe-filters { position: relative; z-index: 5; }
.fe-ms { position: relative; }
.fe-ms-btn { text-align: left; cursor: pointer; min-width: 150px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.fe-ms-btn.active { border-color: var(--accent); color: var(--text); }
.fe-ms-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; min-width: 260px; max-width: min(360px, 90vw); max-height: 360px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.5); padding: 6px; display: grid; gap: 2px; }
.fe-ms-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 8px 2px; }
.fe-ms-item { padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.fe-ms-item:hover { background: var(--surface-2); }
.fe-ms-item .ico { width: 15px; height: 15px; color: var(--muted); flex: none; }
.fe-ms-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-ms-pop .btn.block { margin-top: 4px; }
.fe-new { display: block; margin: 0 auto 10px; border-radius: 999px; }

/* ---- журнал событий: таблица ---- */
.fe-src { display: inline-flex; align-items: center; gap: 6px; }
.fe-src .ico { width: 15px; height: 15px; color: var(--muted); flex: none; }
.table tr.fe-fresh td { animation: fe-flash 2.5s ease-out; }
@keyframes fe-flash { from { background: var(--accent-soft); } to { background: transparent; } }
.fe-pager { background: var(--surface); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); margin-top: -1px; }
.table-wrap:has(+ .fe-pager:not(.hidden)) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

/* ---- карточка события ---- */
.fe-card { gap: 14px; }
.fe-frame { display: block; border-radius: 8px; overflow: hidden; background: #000; }
.fe-frame img { width: 100%; display: block; }
.fe-noframe { aspect-ratio: 16 / 9; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); background: var(--surface-2); font-size: 14px; }
.fe-noframe .ico { width: 28px; height: 28px; opacity: .6; }
.fe-plate-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fe-plate-row .plate-text { font-size: 18px; }
.fe-plate-img { height: 44px; max-width: 200px; object-fit: contain; border-radius: 4px; background: #fff; }
.fe-h { margin: 0; }
.fe-evvideo-box { gap: 8px; }
.fe-evvideo-wrap { background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; }
.fe-evvideo { width: 100%; height: 100%; display: block; object-fit: contain; }
.fe-comment { white-space: pre-wrap; margin: 0; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; font-size: 14px; }

/* ---- телефоны ---- */
@media (max-width: 760px) {
  .fe-name { max-width: 200px; }
  .fe-ms, .fe-ms-btn { flex: 1 1 140px; max-width: none; min-width: 0; width: 100%; }
}
@media (max-width: 600px) {
  .drawer { width: 100%; border-left: 0; }
  .fe-ms-pop { position: fixed; left: 12px; right: 12px; top: auto; max-width: none; min-width: 0; }
  .page-head .page-actions { flex-wrap: wrap; }
}

/* поля события: номер, описание объекта (Qwen3-VL), вложенные объекты */
.fe-search { position: relative; display: flex; align-items: center; flex: 1 1 320px; min-width: 260px; max-width: 460px; }
.fe-search .ico { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.filters .fe-search .input { width: 100%; padding-left: 32px; }
.fe-fields, .feed-fields, .alert-fields { font-size: 13px; display: flex; gap: 2px 0; align-items: center; flex-wrap: wrap; }
.fe-field { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fe-field-vlm { font-weight: 600; }
.fe-card-fields { min-width: 0; }
.fe-field-big { font-size: 16px; }
.fe-field-big .plate-text { font-size: 18px; }
.fe-field-list { display: grid; gap: 4px; font-size: 15px; }
.fe-field-list .fe-field { display: flex; }
/* миниатюра объекта по рамке детекции: машина/человек целиком, без обрезки */
.ev-thumb.obj { width: 96px; height: 64px; aspect-ratio: auto; background: #000; display: grid; place-items: center; }
.feed-thumb.obj { background: #000; display: grid; place-items: center; }
.ev-thumb.obj img, .feed-thumb.obj img { object-fit: contain; }
.fe-obj-row { display: flex; gap: 14px; align-items: center; }
.fe-obj-img { max-height: 120px; max-width: 160px; border-radius: 6px; object-fit: contain; background: var(--surface-2); }
@media (max-width: 760px) { .fe-search { max-width: none; flex-basis: 100%; } }
