/* Velyx Management — module Entreprises, organisations & illégal (variables et classes du socle uniquement). */

/* Couleur d'une entreprise (donnée du jeu, posée en style en ligne). */
.jb-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: var(--faint); border: 0; }

/* Logos. */
.thumb.jb-logo { width: 44px; height: 44px; aspect-ratio: 1; border: 0; flex: none; }
.thumb.jb-logo.sm { width: 40px; height: 40px; }
.thumb.jb-logo.lg { width: 56px; height: 56px; }
.thumb.jb-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb.jb-logo .kind-ic { width: 22px; height: 22px; }
.thumb.jb-mini { width: 56px; aspect-ratio: 16 / 9; }
.thumb.jb-mini .kind-ic { width: 18px; height: 18px; }

/* Cartes de la liste. */
.ocard .banner.jb-banner { height: 64px; }
.jb-card-head { display: flex; gap: 10px; align-items: center; margin-top: -32px; min-width: 0; }
.jb-card-head .jb-logo { background-color: var(--surface); }
.jb-card-title { display: grid; min-width: 0; padding-top: 26px; }
.jb-badges { gap: 4px; min-height: 22px; }
.jb-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.jb-stats > span { display: inline-flex; align-items: center; gap: 5px; }
.jb-stats svg { width: 14px; height: 14px; color: var(--muted); }

/* En-tête de fiche avec bannière. */
.hero.jb-hero { background-size: cover; background-position: center right; }
.jb-title { display: inline-flex; align-items: center; gap: 14px; }

/* Réglages : images, couleur, interrupteurs. */
.jb-img-field { display: grid; gap: 10px; align-content: start; }
.thumb.jb-prev { aspect-ratio: auto; border: 0; }
.thumb.jb-prev.logo { width: 120px; height: 120px; }
.thumb.jb-prev.banner { width: 100%; height: 72px; }
.thumb.jb-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.jb-picker { width: 44px; height: 40px; padding: 2px; flex: none; cursor: pointer; }
.jb-toggle-field { align-self: end; padding-bottom: 10px; }

/* Éditeur de grades. */
.jb-rank .card-head h2 { white-space: nowrap; }
.jb-up { transform: rotate(180deg); }
.jb-perms { box-shadow: inset 0 1px 0 var(--line); padding: 12px 18px 16px; }
.jb-perms > summary { cursor: pointer; font-family: var(--display); font-size: 12px; color: var(--ink-2); padding: 4px 0; }
.jb-perms[open] > summary { margin-bottom: 12px; }
.jb-perms .callout { margin-bottom: 12px; }
.jb-perms .perm-row { cursor: pointer; }

/* Résultats de recherche (recrutement, véhicule à donner). */
.jb-results { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.jb-result { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border: 0; background: var(--surface-2); color: var(--ink); cursor: pointer; font: inherit; }
.jb-result small { color: var(--muted); font-size: 12px; }
.jb-result:hover { box-shadow: inset 0 0 0 1px rgba(var(--c-glass-rgb), .2); background: rgba(var(--c-glass-rgb), .07); }
.jb-result.on, .inv-slot.jb-on { background: var(--inv-brand); color: var(--inv-on-brand); box-shadow: var(--glow); }

/* Montants entrants / sortants. */
.jb-in { color: var(--accent-text); }
.jb-out { color: var(--danger); }

/* Braquages : réglages en lignes. */
.jb-field-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px 230px; gap: 12px; align-items: center; padding: 10px 18px; box-shadow: inset 0 -1px 0 var(--line); }
.jb-field-row:last-child { box-shadow: none; }
.jb-field-row b { font-size: 13px; display: block; }
.jb-field-row small { color: var(--muted); font-size: 12px; }
.jb-field-row.changed { background: var(--accent-soft); }
.jb-field-row input { width: 100%; }

@media (max-width: 640px) {
  .jb-field-row { grid-template-columns: minmax(0, 1fr); }
  .thumb.jb-logo.lg { width: 44px; height: 44px; }
  .jb-title { gap: 10px; }
}

/* Formulaires de la fiche : champs alignés en haut, couleur sur une ligne. */
.edit-grid.jb-form { align-items: start; }
.jb-color-row { display: flex; gap: 8px; align-items: center; }
.jb-color-row input[type="text"] { flex: 1; min-width: 0; }
.jb-field-row .toggle { justify-self: start; }

/* Actions sensibles (réglages) : libellé + bouton. */
.perm-row.jb-action-row { grid-template-columns: minmax(0, 1fr) auto; }
.perm-row.jb-action-row small { display: block; color: var(--muted); font-size: 12px; }

/* Véhicules de la société. */
.ocard .thumb.jb-vehicle { aspect-ratio: 16 / 9; width: 100%; }
.thumb.jb-vehicle-big { aspect-ratio: 16 / 9; width: 100%; }

/* Systèmes liés : aperçu par système, une seule liste par onglet (elle remplit la hauteur). */
.jb-sys-cards .ocard .body { display: grid; gap: 10px; }
.jb-sys-views { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.jb-sys-views > span { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.jb-sys-holder { min-height: 0; }

@media (max-width: 640px) {
  .perm-row.jb-action-row { grid-template-columns: minmax(0, 1fr); }
}

/* Illégal : carte des territoires, palier d'organisation. */
.mini-map.cr-map { height: 460px; }
.cr-level { display: grid; gap: 6px; margin-bottom: 12px; }
.cr-level b { font-size: 15px; }
.ocard .body > .bar { margin: 2px 0 4px; }
@media (max-width: 640px) { .mini-map.cr-map { height: 300px; } }
