/* AFIS Ops Manager 2.39.0 - agents de quart, main courante (UTC), releve ATS,
 * mouvements ADS-B, inspection de piste. Ecran de vigie tactile : cibles de
 * 46 px, lisible au telephone (390 px) comme sur l'ecran de tour, mode nuit
 * par les variables de .afis-vigie. */

/* L'attribut hidden doit l'emporter sur les display des blocs ci-dessous. */
.afq [hidden], .afmc [hidden], .afr [hidden], .afi [hidden], .afq-dialog [hidden], .afr-graphes[hidden] { display: none !important; }

.afq, .afmc, .afr, .afi, .afq-dialog { --q-fond: var(--v-fond, #fff); --q-fond2: var(--v-fond2, #f6f7f7); --q-bord: var(--v-bord, #d5d7da);
    --q-texte: var(--v-texte, #1d2327); --q-doux: var(--v-doux, #50575e); --q-accent: var(--v-accent, #2271b1);
    --q-vert: var(--v-vert, #135e2a); --q-ambre: var(--v-ambre, #996800); --q-rouge: var(--v-rouge, #b32d2e); }

/* ---------- boutons ---------- */
.afq-btn {
    min-height: 46px; padding: 6px 16px; border-radius: 8px; border: 1px solid var(--q-bord);
    background: var(--q-fond); color: var(--q-texte); font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
    touch-action: manipulation;
}
.afq-btn:hover { border-color: var(--q-accent); }
.afq-btn:disabled { opacity: .45; cursor: not-allowed; }
.afq-btn-prim { background: var(--q-accent); border-color: var(--q-accent); color: #fff; }
.afq-btn-fin { min-height: 40px; font-size: 14px; border-color: var(--q-ambre); color: var(--q-ambre); }
.afq-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 12px; }

/* ---------- agents de quart ---------- */
.afq { border: 2px solid var(--q-accent); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; background: var(--q-fond); }
.afq-tete { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.afq-titre strong { display: block; font-size: 17px; }
.afq-titre span { font-size: 13px; color: var(--q-doux); }
.afq-liste { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.afq-agent {
    display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "trig nom fin" "trig h fin";
    gap: 2px 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--q-bord); border-radius: 8px; background: var(--q-fond2);
}
.afq-agent.actif { border-color: var(--q-vert); box-shadow: inset 4px 0 0 var(--q-vert); }
.afq-trig {
    grid-area: trig; min-width: 74px; min-height: 52px; border-radius: 8px; border: 2px solid var(--q-bord); background: var(--q-fond);
    color: var(--q-texte); font: inherit; font-size: 20px; font-weight: 800; letter-spacing: 1px; cursor: pointer;
}
.afq-agent.actif .afq-trig { border-color: var(--q-vert); background: var(--q-vert); color: #fff; }
.afq-nom { grid-area: nom; font-weight: 600; overflow-wrap: anywhere; }
.afq-h { grid-area: h; font-size: 14px; color: var(--q-doux); }
.afq-h small { margin-left: 4px; font-variant-numeric: tabular-nums; }
.afq-badge { display: none; }
.afq-btn-fin { grid-area: fin; }
.afq-note { font-size: 13px; color: var(--q-doux); margin: 8px 0 0; }
.afq-alerte { margin: 10px 0 0; padding: 9px 12px; border-left: 4px solid var(--q-ambre); background: var(--q-fond2); border-radius: 6px; font-size: 14px; }
.afq-alerte.ko { border-left-color: var(--q-rouge); }
.afq-attrib { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.afq-attrib select { min-height: 42px; flex: 1 1 180px; }
.afq-pin { margin-top: 12px; font-size: 14px; }
.afq-pin summary { cursor: pointer; color: var(--q-doux); min-height: 32px; }
.afq-pin-ligne { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.afq-pin-ligne input, .afq-pin-ligne select { min-height: 44px; flex: 1 1 120px; font-size: 16px; }
.cdmx-saisit { font-size: 12px; margin-left: 6px; color: var(--v-doux, #50575e); white-space: nowrap; }

/* ---------- fenetre « prendre le service » ---------- */
.afq-dialog {
    border: 0; border-radius: 12px; padding: 0; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 24px);
    background: var(--q-fond); color: var(--q-texte); box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}
.afq-dialog::backdrop { background: rgba(10, 14, 18, .55); }
.afq-dialog-corps { padding: 16px; display: block; }
.afq-dialog h3 { margin: 0 0 6px; font-size: 19px; }
.afq-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin: 12px 0; }
.afq-choix {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 76px; padding: 6px;
    border: 2px solid var(--q-bord); border-radius: 10px; background: var(--q-fond2); color: var(--q-texte); font: inherit; cursor: pointer;
}
.afq-choix b { font-size: 22px; letter-spacing: 1px; }
.afq-choix span { font-size: 12px; color: var(--q-doux); text-align: center; overflow-wrap: anywhere; }
.afq-choix em { font-size: 11px; font-style: normal; color: var(--q-ambre); }
.afq-choix.choisi { border-color: var(--q-accent); background: var(--q-accent); color: #fff; }
.afq-choix.choisi span, .afq-choix.choisi em { color: #fff; }
.afq-choix.bloque { border-style: dashed; }
.afq-choix:disabled { opacity: .5; }
.afq-etape { margin: 8px 0; }
.afq-etape label { display: block; font-weight: 600; font-size: 14px; }
.afq-etape input, .afq-etape textarea { display: block; width: 100%; margin-top: 4px; min-height: 46px; font-size: 18px; padding: 6px 10px; }
.afq-etape textarea { font-size: 15px; }
.afq-case { display: flex !important; gap: 8px; align-items: flex-start; font-weight: 400 !important; margin-top: 8px; }
.afq-case input { width: auto !important; min-height: 0 !important; margin-top: 3px; }
.afq-bloquants { border-left: 4px solid var(--q-rouge); padding: 6px 10px; background: var(--q-fond2); font-size: 14px; }
.afq-bloquants ul { margin: 4px 0 0 18px; padding: 0; }
.afq-msg { min-height: 1.4em; color: var(--q-rouge); font-weight: 600; margin: 6px 0 0; }
.afq-dialog-pin { width: min(360px, calc(100vw - 24px)); }
.afq-dialog-pin input { width: 100%; min-height: 50px; font-size: 24px; letter-spacing: 6px; text-align: center; margin: 10px 0; }

/* ---------- main courante ---------- */
.afmc-form { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; align-items: end; margin-bottom: 12px; }
.afmc-form label span { display: block; font-size: 13px; color: var(--q-doux); }
.afmc-form input { width: 100%; min-height: 46px; font-size: 16px; padding: 4px 8px; }
.afmc-liste { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--q-bord); }
.afmc-l { display: grid; grid-template-columns: 62px 48px 1fr auto; gap: 8px; align-items: start; padding: 8px 2px; border-bottom: 1px solid var(--q-bord); font-size: 15px; }
.afmc-h { font-weight: 700; font-variant-numeric: tabular-nums; }
.afmc-h small { font-weight: 400; color: var(--q-doux); }
.afmc-trig { display: inline-block; font-weight: 800; font-size: 13px; letter-spacing: .5px; padding: 1px 6px; border-radius: 5px; background: var(--q-fond2); border: 1px solid var(--q-bord); }
.afmc-corps { overflow-wrap: anywhere; min-width: 0; }
.afmc-type { font-style: normal; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--q-accent); }
.afmc-service_prise, .afmc-service_fin { color: var(--q-doux); font-size: 14px; }
.afmc-releve_prise .afmc-type, .afmc-releve_fin .afmc-type { color: var(--q-vert); }
.afmc-l.annule .afmc-corps { text-decoration: line-through; color: var(--q-doux); }
.afmc-ann { display: block; text-decoration: none; font-size: 12px; color: var(--q-rouge); }
.afmc-x { background: none; border: 0; color: var(--q-doux); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; min-height: 32px; }

/* ---------- releve ATS ---------- */
.afmc-releve { margin-top: 8px; }
.afmc-releve-liste { list-style: none; margin: 0 0 10px; padding: 0; }
.afmc-releve-l { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; border-left: 4px solid var(--q-vert); background: var(--q-fond2); border-radius: 6px; margin-bottom: 6px; }
.afmc-releve-l.releve_fin { border-left-color: var(--q-ambre); }
.afmc-releve-boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.afmc-releve-boutons .afq-btn { flex: 1 1 260px; }
.afmc-releve-form { margin-top: 12px; padding: 12px; border: 1px solid var(--q-bord); border-radius: 10px; background: var(--q-fond2); }
.afmc-releve-form h4 { margin: 0 0 8px; }
.afmc-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.afmc-grille label span, .afmc-large span { display: block; font-size: 13px; color: var(--q-doux); }
.afmc-grille input, .afmc-grille select, .afmc-large textarea { width: 100%; min-height: 44px; font-size: 16px; padding: 4px 8px; }
.afmc-large { display: block; margin-top: 8px; }

/* ---------- mouvements ADS-B ---------- */
.afr-liste { margin-top: 12px; display: grid; gap: 10px; }
.afr-carte { border: 1px solid var(--q-bord); border-left: 4px solid var(--q-accent); border-radius: 8px; padding: 10px 12px; background: var(--q-fond); }
.afr-carte.afr-depart { border-left-color: var(--q-ambre); }
.afr-tete { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.afr-tete select { min-height: 40px; }
.afr-ev-l { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 15px; cursor: pointer; }
.afr-ev-l input { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 1px; }
.afr-ev-l em { color: var(--q-vert); font-size: 13px; }
.afr-graphes { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; align-items: flex-start; }
.afr-graphes svg { max-width: 100%; height: auto; border: 1px solid var(--q-bord); border-radius: 6px; }
.afr-graphes .afr-profil, .afr-graphes > svg:first-child { flex: 1 1 300px; }
.afr-detail { margin-top: 6px; }
.afr-detail { overflow-x: auto; }
.afr-ev { width: 100%; min-width: 420px; border-collapse: collapse; font-size: 13px; }
.afr-ev th, .afr-ev td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--q-bord); vertical-align: top; }
.afr-ev td:nth-child(1), .afr-ev td:nth-child(3), .afr-ev td:nth-child(4), .afr-ev th { white-space: nowrap; }
.afr-detail .afr-graphes { flex-wrap: wrap; }
.afr-detail .afr-profil { flex: 1 1 260px; min-width: 0; }
.afr-detail .afr-trace { flex: 0 0 150px; }
.afr-detail .afr-trace svg { width: 150px; height: 150px; }
.afr-note { font-size: 12px; color: var(--q-doux); margin: 4px 0 0; }

/* ---------- inspection ---------- */
.afi-form { border: 1px solid var(--q-bord); border-radius: 10px; padding: 12px; background: var(--q-fond2); margin-bottom: 14px; }
.afi-ligne1 { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.afi-etats { margin: 10px 0; }
.afi-anom { border: 1px solid var(--q-bord); border-left: 4px solid var(--q-ambre); border-radius: 8px; margin: 10px 0; padding: 8px 10px; background: var(--q-fond); }
.afi-anom legend { font-weight: 700; padding: 0 4px; }
.afi-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.afi-grille label span { display: block; font-size: 13px; color: var(--q-doux); }
.afi-grille input, .afi-grille select { width: 100%; min-height: 44px; font-size: 16px; padding: 4px 8px; }
.afi-photo-ajout { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; padding: 10px; border: 2px dashed var(--q-bord); border-radius: 8px; cursor: pointer; font-size: 14px; }
.afi-photo-ajout input { max-width: 100%; }
.afi-apercu, .afi-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.afi-vign { position: relative; display: inline-block; }
.afi-vign img { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--q-bord); display: block; }
.afi-vign.ko { color: var(--q-rouge); font-size: 13px; }
.afi-vign-x { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--q-rouge); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.afi-vign-ajout { display: inline-flex; align-items: center; justify-content: center; width: 84px; height: 84px; border: 2px dashed var(--q-bord); border-radius: 6px; font-size: 13px; color: var(--q-doux); cursor: pointer; overflow: hidden; }
.afi-vign-ajout input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.afi-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.afi-item { border: 1px solid var(--q-bord); border-radius: 8px; padding: 8px 10px; }
.afi-tete { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.afi-tete small { color: var(--q-doux); }
.afi-res { font-size: 13px; font-weight: 700; padding: 1px 8px; border-radius: 10px; }
.afi-res.ok { color: var(--q-vert); border: 1px solid var(--q-vert); }
.afi-res.ko { color: var(--q-rouge); border: 1px solid var(--q-rouge); }
.afi-tete .afis-releve-x { margin-left: auto; }
.afi-anoms { margin: 6px 0 0 18px; padding: 0; font-size: 14px; }
.afi-anoms li.g-forte, .afi-anoms li.g-fermeture { color: var(--q-rouge); }

/* ---------- presences, cloture ---------- */
.afis-presence-utc { font-size: 12px; color: var(--v-doux, #50575e); align-self: center; font-variant-numeric: tabular-nums; }
.afis-ajout-details { margin-top: 12px; }
.afis-ajout-details summary { cursor: pointer; min-height: 36px; color: var(--v-doux, #50575e); }
.afis-cloture-case { margin: 0 0 10px; }
.afis-prise-autre { margin: 18px 0 0; padding: 12px 14px; border: 1px dashed #98a2ad; border-radius: 10px; }
.afis-prise-autre p { margin: 0 0 10px; font-size: 14px; }

@media (max-width: 600px) {
    .afq-agent { grid-template-columns: auto 1fr; grid-template-areas: "trig nom" "trig h" "fin fin"; }
    .afq-btn-fin { width: 100%; }
    .afq-tete .afq-btn-prim { width: 100%; }
    .afmc-form { grid-template-columns: 1fr; }
    .afmc-l { grid-template-columns: 54px 44px 1fr; }
    .afmc-x { grid-column: 3; justify-self: start; }
    .afq-grille { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
    .afr-graphes svg { width: 100%; }
}
