/* Evidencia vozidiel – vrátnica */
.ve-hidden { display: none !important; }

.ve-mode-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin: 0;
  flex-wrap: wrap;
  align-items: center;
  background: #fff;
  border-bottom: 2px solid #dbeafe;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.06);
}

html.is-staff-page .ve-mode-bar {
  flex-shrink: 0;
}

html.is-staff-page .staff-app > .ve-mode-bar {
  flex-shrink: 0;
}

html.is-staff-page #ve-root:not(.ve-hidden) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.ve-mode-btn {
  flex: 1;
  min-width: 8rem;
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  border: 1px solid #e4e8f2;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ve-mode-btn.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.ve-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.ve-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem;
  background: #fff;
  border: 1px solid #e4e8f2;
  border-radius: 0.75rem;
  margin-bottom: 0.5rem;
}

.ve-back-plan {
  min-width: 5.5rem;
  font-weight: 700;
}

.staff-app > header .flex.items-center[role='button']:active {
  opacity: 0.85;
}

.ve-toolbar input[type="date"],
.ve-toolbar input[type="search"] {
  padding: 0.4rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.ve-btn-primary {
  background: #15803d;
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  padding: 0.65rem 1rem;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
}

.ve-btn-secondary {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  cursor: pointer;
}

.ve-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid #e4e8f2;
  border-radius: 0.75rem;
  background: #fff;
}

.ve-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.ve-table th,
.ve-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  white-space: nowrap;
}

.ve-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  font-weight: 700;
  z-index: 1;
  user-select: none;
}

.ve-th {
  cursor: grab;
}

.ve-th-dragging {
  opacity: 0.45;
}

.ve-th-drop-target {
  background: #dbeafe !important;
  outline: 2px dashed #3b82f6;
}

.ve-th-label {
  display: inline-block;
  padding-right: 0.35rem;
}

.ve-col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}

.ve-col-resizer:hover {
  background: rgba(59, 130, 246, 0.35);
}

body.ve-col-resizing {
  cursor: col-resize !important;
  user-select: none;
}

.ve-date-clear {
  min-width: 2rem;
  padding: 0.4rem 0.5rem;
  font-weight: 700;
  line-height: 1;
}

.ve-entry-date {
  font-weight: 700;
  color: #334155;
}

.ve-entry-time {
  color: #64748b;
  font-size: 0.6875rem;
}

.ve-notes-td {
  white-space: normal !important;
  min-width: 6rem;
}

.ve-notes-cell {
  min-width: 0;
}

.ve-notes-input {
  width: 100%;
  min-width: 5rem;
  padding: 0.25rem 0.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.35rem;
  font-size: 0.6875rem;
  background: #fff;
}

.ve-notes-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.ve-notes-wizard {
  text-transform: none !important;
  letter-spacing: normal !important;
  text-align: left !important;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
}

.ve-time-td {
  white-space: normal !important;
  min-width: 8.5rem;
}

.ve-time-input {
  width: 100%;
  min-width: 8rem;
  padding: 0.2rem 0.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.35rem;
  font-size: 0.6875rem;
  background: #fff;
}

.ve-time-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.ve-col-settings {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ve-col-setting-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #e2e8f0;
  font-size: 0.8125rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #334155;
}

.ve-col-setting-name {
  flex: 1;
  min-width: 5rem;
}

.ve-col-label-input {
  flex: 1;
  min-width: 6rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.4rem;
  border: 1px solid #475569;
  background: #fff;
  color: #0f172a;
  font-size: 0.8125rem;
}

.ve-log-panel {
  padding: 0.75rem;
  overflow: auto;
  max-height: 70vh;
}

.ve-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.6875rem;
  color: #e2e8f0;
}

.ve-log-table th,
.ve-log-table td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid #334155;
  text-align: left;
  vertical-align: top;
}

.ve-log-table th {
  color: #94a3b8;
  font-weight: 700;
}

.ve-log-val {
  max-width: 10rem;
  word-break: break-word;
  font-family: ui-monospace, monospace;
  font-size: 0.625rem;
}

.ve-badge-db {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
}

.ve-badge-yard {
  background: #fef3c7;
  color: #92400e;
}

.ve-badge-done {
  background: #e2e8f0;
  color: #475569;
}

/* Modal / kamera */
.ve-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  flex-direction: column;
  padding: max(0.5rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right)) max(0.5rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
}

.ve-overlay-inner {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: none;
  width: 100%;
  background: #0f172a;
  border-radius: 1rem;
  overflow: visible;
}

#ve-overlay-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.ve-overlay-header {
  padding: 0.75rem 1rem;
  color: #fff;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.ve-overlay-header span {
  flex: 1;
  min-width: 0;
}

.ve-btn-close {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0.65rem;
  background: #fff;
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.35);
}

.ve-btn-close:active {
  background: #e2e8f0;
}

.ve-video-wrap {
  flex: 1;
  min-height: 180px;
  max-height: 55vh;
  position: relative;
  background: #000;
  overflow: hidden;
}

.ve-plate-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ve-plate-frame-box {
  width: min(92%, 22rem);
  height: 4.5rem;
  border: 3px solid rgba(74, 222, 128, 0.95);
  border-radius: 0.5rem;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}

.ve-plate-frame-label {
  margin-top: 0.65rem;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 1px 3px #000;
}

.ve-plate-actions {
  display: flex;
  gap: 0.5rem;
}

.ve-plate-actions .ve-btn-secondary {
  flex: 1;
  min-height: 2.5rem;
  background: #334155;
  border-color: #475569;
  color: #f8fafc;
}

.ve-suggest-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.ve-suggest-btn {
  border: 1px solid #3b82f6;
  background: #1e3a8a;
  color: #fff;
  border-radius: 0.5rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.ve-start-step {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.75rem;
  padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
}

.ve-start-lead {
  color: #bbf7d0 !important;
  text-align: left !important;
  line-height: 1.45;
  margin-bottom: 0.65rem;
}

.ve-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.45rem;
  margin: 0.65rem 0 1rem;
  max-height: 45vh;
  overflow: auto;
}

.ve-plan-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.55rem 0.6rem;
  border: 2px solid #3b82f6;
  border-radius: 0.65rem;
  background: #1e3a8a;
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.ve-plan-chip strong {
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.ve-plan-chip small {
  font-size: 0.65rem;
  opacity: 0.9;
  line-height: 1.2;
}

.ve-plan-empty {
  text-align: left !important;
  margin-bottom: 0.75rem;
}

.ve-video-wrap video,
.ve-video-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ve-overlay-actions {
  flex-shrink: 0;
  padding: 0.75rem 0.75rem calc(2.75rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: #1e293b;
}

.ve-overlay-actions.ve-form-step {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px));
}

.ve-overlay-actions .ve-btn-secondary {
  min-height: 2.75rem;
  font-size: 0.9375rem;
  padding: 0.75rem 1rem;
  background: #334155;
  border-color: #475569;
  color: #f8fafc;
}

.ve-form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.ve-overlay-actions .ve-btn-primary {
  padding: 0.85rem 1rem;
  min-height: 3rem;
  font-size: 1rem;
  -webkit-tap-highlight-color: transparent;
}

.ve-overlay-actions .ve-btn-primary:disabled,
.ve-overlay-actions .ve-btn-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ve-busy {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.ve-ocr-hint {
  min-height: 1rem;
  color: #93c5fd !important;
}

.ve-plate-input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  border-radius: 0.5rem;
  border: 2px solid #3b82f6;
  color: #0f172a;
  background: #fff;
}

.ve-route-select,
.ve-overlay-actions select {
  color: #0f172a !important;
  background: #fff !important;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
  text-align: left;
}

.ve-hint {
  color: #94a3b8;
  font-size: 0.75rem;
  text-align: center;
}

.ve-catalog-hit {
  background: #14532d;
  color: #bbf7d0;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  text-align: center;
}

.ve-catalog-miss {
  background: #7c2d12;
  color: #fed7aa;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  text-align: center;
}

.ve-photo-cell {
  white-space: normal !important;
  min-width: 5.5rem;
}

.ve-photo-btn {
  display: block;
  width: 100%;
  margin: 0.15rem 0;
  padding: 0.25rem 0.35rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  background: #f8fafc;
  font-size: 0.65rem;
  cursor: pointer;
}

.ve-no-photo {
  color: #94a3b8;
  font-size: 0.65rem;
}

.ve-plate-link {
  color: #1d4ed8;
  cursor: pointer;
  text-decoration: underline;
}

.ve-detail {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.ve-detail-head {
  padding: 0.75rem;
  color: #e2e8f0;
  font-size: 0.8125rem;
  line-height: 1.5;
  background: #1e293b;
}

.ve-detail-head p {
  margin: 0.25rem 0;
}

.ve-detail-photos {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #0f172a;
}

.ve-photo-block {
  background: #1e293b;
  border-radius: 0.75rem;
  overflow: hidden;
}

.ve-photo-block span {
  display: block;
  padding: 0.5rem 0.75rem;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
}

.ve-photo-block img {
  display: block;
  width: 100%;
  max-height: 45vh;
  object-fit: contain;
  background: #000;
}

.ve-photo-missing p {
  margin: 0;
  padding: 1.5rem;
  text-align: center;
  color: #64748b;
}

.ve-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem 0.75rem calc(2.75rem + env(safe-area-inset-bottom, 0px));
  background: #1e293b;
}

.ve-detail-actions .ve-btn-primary,
.ve-detail-actions .ve-btn-secondary {
  min-height: 3rem;
  font-size: 1rem;
  padding: 0.85rem 1rem;
}

.ve-detail-actions .ve-btn-secondary {
  background: #334155;
  border-color: #475569;
  color: #f8fafc;
}

@media (max-width: 640px) {
  .ve-table { font-size: 0.6875rem; }
  .ve-mode-btn { min-width: calc(50% - 0.25rem); }
}
