/* Area del docente: menu, gestione di aerei e aeroporti, account. */

.subnav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 1rem;
    padding: 0.35rem 1rem;
    background: #10151c;
    border-bottom: 1px solid var(--edge);
    font-size: 0.9rem;
}
.subnav a { color: var(--ink-dim); text-decoration: none; }
.subnav a.active { color: var(--ink); font-weight: 600; }
.subnav__who { margin-left: auto; color: var(--ink-dim); }

button.linkish {
    padding: 0;
    border: none;
    background: none;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
}
button.linkish:disabled { color: var(--ink-dim); cursor: default; }

.hint { color: var(--ink-dim); font-size: 0.85rem; }
.form__note { margin: 0; color: var(--ok); }
.form h2 { margin: 1rem 0 0; font-size: 1.1rem; }

/* --- elenco + editor ------------------------------------------------------- */

.manager {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(12rem, 16rem) 1fr;
}
.manager__list {
    padding: 1rem;
    border-right: 1px solid var(--edge);
    overflow-y: auto;
}
.manager__list h1 { margin: 0 0 0.75rem; font-size: 1.25rem; }

.picklist { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.picklist button {
    width: 100%;
    padding: 0.4rem 0.55rem;
    border: 1px solid transparent;
    border-radius: 5px;
    background: none;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.picklist button:hover { background: var(--panel); }
.picklist .picklist--on { border-color: var(--accent); background: var(--panel); }
.picklist__id { display: block; color: var(--ink-dim); font-size: 0.75rem; }

.editor { padding: 1rem 1.25rem 2rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.9rem; }
.editor__head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.editor__head h2 { margin: 0; font-size: 1.2rem; flex: 1 1 auto; }
.editor__ok { color: var(--ok); }
.editor__problems {
    margin: 0;
    padding: 0.5rem 0.75rem 0.5rem 1.75rem;
    border: 1px solid var(--alarm);
    border-radius: 6px;
    background: rgba(255, 77, 77, 0.08);
    color: #ffb3b3;
    font-size: 0.9rem;
}

.editor fieldset, .gauge-fields {
    margin: 0;
    padding: 0.6rem 0.8rem 0.8rem;
    border: 1px solid var(--edge);
    border-radius: 6px;
}
.editor legend { padding: 0 0.3rem; color: var(--ink); font-weight: 600; }

.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.55rem 0.8rem; }
.field-grid--narrow { grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); }
.field { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.field--wide { grid-column: span 2; }
.field__label { color: var(--ink-dim); font-size: 0.8rem; }
.field__unit { margin-left: 0.25em; color: var(--ink-dim); font-size: 0.75rem; font-weight: 400; }
.item .linkish + .linkish { margin-left: 1rem; }

.editor input, .editor select, .rows input {
    width: 100%;
    min-width: 0;
    padding: 0.35rem 0.45rem;
    border: 1px solid var(--edge);
    border-radius: 5px;
    background: #10151c;
    color: var(--ink);
    font: inherit;
}
.editor input:disabled { color: var(--ink-dim); }
.editor input.short { width: 5.5rem; flex: 0 0 auto; }

.rows { border-collapse: collapse; margin-bottom: 0.4rem; }
.rows th { color: var(--ink-dim); font-size: 0.8rem; font-weight: 400; text-align: left; padding: 0 0.4rem 0.2rem 0; }
.rows td { padding: 0.15rem 0.4rem 0.15rem 0; }

.item { padding: 0.4rem; border-radius: 5px; border: 1px solid transparent; }
.item--on { border-color: var(--accent); }
.item--row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.item--row .field--inline { flex-direction: row; align-items: center; gap: 0.4rem; }
.item--row .field--inline input { width: 6rem; }

/* --- editor degli aeroporti: mappa grande e colonna dei dati ---------------- */

.airport-editor {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr minmax(22rem, 30rem);
    grid-template-rows: auto 1fr;
}
.airport-editor__map { grid-column: 1; grid-row: 2; min-height: 20rem; border-radius: 0; }
.airport-editor .toolbar { grid-column: 1; grid-row: 1; }
.airport-editor .editor--side { grid-column: 2; grid-row: 1 / span 2; border-left: 1px solid var(--edge); }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    background: var(--panel);
    border-bottom: 1px solid var(--edge);
}
.toolbar button {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--edge);
    border-radius: 5px;
    background: #10151c;
    color: var(--ink);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}
.toolbar__hint { flex: 1 1 14rem; color: var(--ink-dim); font-size: 0.85rem; }

@media (max-width: 900px) {
    .manager { grid-template-columns: 1fr; }
    .manager__list { border-right: none; border-bottom: 1px solid var(--edge); max-height: 14rem; }
    .airport-editor { grid-template-columns: 1fr; grid-template-rows: auto 22rem auto; }
    .airport-editor .editor--side { grid-column: 1; grid-row: 3; border-left: none; }
}

/* --- piccole aggiunte a strip e barra ------------------------------------- */

.chip--elevation { background: #0b3d80; color: #fff; }
.strip__agl { margin-left: 0.3rem; color: var(--ink-dim); font-size: 0.85em; }

/* --- ora della lezione ----------------------------------------------------- */

.chip--time { font-variant-numeric: tabular-nums; }
.chip--fast { background: #7a2cff; color: #fff; }
.chip__sub { margin-left: 0.3em; opacity: 0.8; font-variant-numeric: tabular-nums; }

/* --- timeline del docente ---------------------------------------------------- */

.timeline {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.45rem 0.8rem 0.55rem;
    background: var(--panel);
    border-top: 1px solid var(--edge);
}
.timeline__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.timeline button {
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--edge);
    border-radius: 5px;
    background: #10151c;
    color: var(--ink);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}
.timeline button.is-on { border-color: var(--accent); background: #0f2a47; }
.timeline button.danger { border-color: var(--alarm); color: #ffb3b3; }
.timeline__pause.is-on { border-color: var(--warn); color: var(--warn); }
.timeline__speeds { display: inline-flex; gap: 0.2rem; }
.timeline__now { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-dim); }
.timeline__preview { color: var(--warn); }
.timeline__rewind { border-color: var(--warn) !important; color: var(--warn) !important; }
.timeline__confirm { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--warn); font-size: 0.85rem; }

.timeline__track { position: relative; height: 1.6rem; }
.timeline__cursor { position: absolute; inset: 0; width: 100%; margin: 0; accent-color: var(--warn); }
.timeline__marker {
    position: absolute;
    top: 0;
    width: 3px;
    height: 0.55rem;
    margin-left: -1px;
    border-radius: 1px;
    background: var(--ink-dim);
    pointer-events: auto;
}
.timeline__marker--pilotjoined, .timeline__marker--pilotleft { background: var(--ok); }
.timeline__marker--held, .timeline__marker--released { background: var(--alarm); }
.timeline__marker--multiplier { background: #a970ff; }
.timeline__marker--paused, .timeline__marker--resumed { background: var(--warn); }
.timeline__marker--rewound { background: #fff; height: 100%; }
.timeline__marker--flyingbeforedaylight, .timeline__marker--flyingafterdaylight { background: var(--alarm); }
.timeline__marker--windchanged, .timeline__marker--runwaychanged { background: #7ff0a8; height: 70%; }

/* --- strip completa e strumenti del docente -------------------------------- */

.strip__mode { padding: 0 0.35rem; border-radius: 3px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; }
.strip__mode--route { background: #d86bff; color: #1a0524; }
.strip__mode--heading { background: var(--accent); color: #06121f; }
.strip__mode--manual { background: var(--warn); color: #1f1600; }
.strip--emergency { border-color: var(--alarm) !important; box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.4); }
.strip__squawk { font-variant-numeric: tabular-nums; font-weight: 700; }
.strip__ident { animation: blink 0.6s steps(2, end) infinite; color: #fff; }
.strip__instructions { list-style: none; margin: 0.25rem 0; padding: 0; font-size: 0.78rem; }
.strip__instructions li { display: flex; gap: 0.35rem; }
.strip__instructions .is-complied { color: var(--ok); }
.strip__instructions .is-pending { color: var(--warn); }
.strip__instructions .is-scheduled { color: var(--ink-dim); font-style: italic; }

.rose { display: inline-flex; align-items: center; gap: 0.2rem; }
.rose svg { width: 1.4rem; height: 1.4rem; }
.rose__ring { fill: #10151c; stroke: #39424f; stroke-width: 1.2; }
.rose__north { fill: var(--ink-dim); font-size: 5px; text-anchor: middle; }
.rose__needle { fill: var(--warn); }
.rose__value { font-variant-numeric: tabular-nums; }

.tools {
    margin-top: 0.6rem;
    padding: 0.6rem;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: #111823;
}
.tools h2 { margin: 0 0 0.4rem; font-size: 1rem; }
.tools h3 { margin: 0 0 0.3rem; font-size: 0.8rem; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.tools__block { padding: 0.4rem 0; border-top: 1px solid var(--edge); }
.tools__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-bottom: 0.3rem; }
.tools__row label { display: flex; align-items: center; gap: 0.25rem; font-size: 0.8rem; color: var(--ink-dim); }
.tools input, .tools select {
    padding: 0.25rem 0.4rem;
    border: 1px solid var(--edge);
    border-radius: 4px;
    background: #10151c;
    color: var(--ink);
    font: inherit;
    font-size: 0.85rem;
}
.tools input[type=number] { width: 5rem; }
.tools input.tools__value { width: 6.5rem; }
.tools input.tools__minutes { width: 4.2rem; }
.tools input[type=checkbox] { width: auto; }
.tools button {
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--edge);
    border-radius: 5px;
    background: #1e242d;
    color: var(--ink);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}
.tools button.tools__primary { border-color: var(--accent); background: #0f2a47; }
.tools button.danger { border-color: var(--alarm); color: #ffb3b3; }
.tools__list { margin: 0.2rem 0 0.4rem 1rem; padding: 0; font-size: 0.8rem; }
.commands__toggle { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; color: var(--ink-dim); }
.checklist-text {
    width: 100%;
    padding: 0.4rem;
    border: 1px solid var(--edge);
    border-radius: 5px;
    background: #10151c;
    color: var(--ink);
    font: inherit;
    font-size: 0.9rem;
}
.strip__data { flex-wrap: wrap; }
.strip__data > span { white-space: nowrap; }

.tools--traffic { border-color: #ff9f43; }
.tools__list--plain { list-style: none; margin-left: 0; }
.traffic-item { display: flex; flex-wrap: wrap; gap: 0.2rem 0.5rem; align-items: baseline; padding: 0.15rem 0; }
.traffic-item span { color: var(--ink-dim); }
.traffic-points input { width: 6rem; }

/* --- scenari --------------------------------------------------------------- */

.filters { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.6rem; }
.filters label { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.8rem; color: var(--ink-dim); }
.filters select, .filters input, .linkform input {
    padding: 0.3rem 0.4rem; border: 1px solid var(--edge); border-radius: 4px; background: #10151c; color: var(--ink); font: inherit;
}
.linkform { display: flex; gap: 0.3rem; margin-top: 0.8rem; }
.linkform input { flex: 1 1 auto; min-width: 0; }
.linkform button, .savescenario button {
    padding: 0.3rem 0.6rem; border: 1px solid var(--edge); border-radius: 5px; background: #1e242d; color: var(--ink); font: inherit; cursor: pointer;
}
.savescenario { display: inline-flex; gap: 0.3rem; align-items: center; }
.savescenario input, .savescenario select {
    padding: 0.3rem 0.4rem; border: 1px solid var(--edge); border-radius: 4px; background: #10151c; color: var(--ink); font: inherit;
}
.sharelink { user-select: all; color: var(--ink); }
.danger-link { color: #ff8a8a !important; margin-left: 1rem; }
.scenario-map { height: 22rem; margin: 0.5rem 0; }
.transfer-warnings { border-color: var(--warn); color: #ffe19a; background: rgba(242, 184, 7, 0.08); }

/* Spazi aerei nell'editor dell'aeroporto. */
.airspaces .item { display: flex; flex-direction: column; gap: 0.35rem; cursor: pointer; }
.airspaces .item--row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.airspace-limits .short { width: 5.5rem; }
.airspace-import { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem; margin-top: 0.5rem; }

/* Conferma di "Elimina" un aeroporto: il nome, cosa succede, gli scenari che lo usano. */
.editor__head button.danger, .remove-confirm button.danger { border-color: var(--alarm); color: #ffb3b3; }
.remove-confirm { border: 1px solid var(--alarm); border-radius: 8px; padding: 0.75rem 1rem; margin: 0.5rem 0 1rem; background: rgba(255, 80, 80, 0.08); }
.remove-confirm p { margin: 0 0 0.5rem; }
.remove-confirm__scenarios { margin: 0 0 0.75rem; padding-left: 1.2rem; }
.scenario-archived { border: 1px solid var(--warn); border-radius: 8px; padding: 0.5rem 0.75rem; color: var(--warn); }

/* A terra, nella strip e negli strumenti. */
.strip__ground { font-size: 0.85rem; color: var(--warn); }
label.check { display: flex; align-items: center; gap: 0.4rem; }

/* Circuito forzato e prove circuito. */
.circuit-tools__buttons { flex-wrap: wrap; }
.circuit-tools__now { color: var(--ok); margin: 0 0 0.4rem; }
.circuit-tools__warn { color: var(--warn); margin: 0.3rem 0; }
.strip__circuit { font-size: 0.85rem; color: var(--ok); }
.strip__mode--circuit { background: #1f6f5c; }
.procedure { border: 1px solid var(--line, #334); border-radius: 6px; padding: 0.3rem 0.5rem; margin: 0.4rem 0; }
.procedure--on { border-color: var(--ok); }
.procedure__steps { margin: 0.3rem 0; padding-left: 1.4rem; }
.procedure__steps .item { flex-wrap: wrap; gap: 0.3rem; }
.procedure__steps select, .procedure__steps input { width: auto; min-width: 0; flex: 0 1 auto; }
.procedure__steps input.short { width: 4.5rem; }

/* --- traffico casuale -------------------------------------------------------------------- */
.random-state { margin-left: 0.4rem; padding: 0 0.4rem; border-radius: 3px; background: var(--edge); color: var(--ink-dim); font-size: 0.75rem; font-weight: 700; }
.random-state--on { background: #ff9f43; color: #2a1400; }
.random-settings { margin: 0.4rem 0; font-size: 0.85rem; }
.random-settings summary { cursor: pointer; font-weight: 600; }
.random-settings input[type=number] { width: 4.6rem; }
.random-settings fieldset { margin: 0.35rem 0 0; padding: 0.3rem 0.5rem; border: 1px solid var(--edge); border-radius: 4px; display: flex; flex-wrap: wrap; gap: 0.25rem 0.8rem; }
.random-settings legend { color: var(--ink-dim); }
.random-list { width: 100%; border-collapse: collapse; margin-top: 0.4rem; font-size: 0.8rem; }
.random-list tr { cursor: pointer; border-top: 1px solid var(--edge); }
.random-list tr.is-selected { background: rgba(255, 159, 67, 0.18); }
.random-list tr.is-coming { opacity: 0.6; }
.random-list td { padding: 0.2rem 0.3rem; vertical-align: top; }
.random-list__callsign { font-weight: 700; white-space: nowrap; }
.random-list__kind { color: var(--ink-dim); }
.random-list__intent { color: #ffd6a8; }
.random-list__next { white-space: nowrap; }
.tools--virtual { border-color: #ff9f43 !important; }
.virtual-tools__buttons button:disabled { opacity: 0.4; }
.strip__name { color: var(--ink-dim); font-weight: 600; }
.lesson-aircraft { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; padding: 0.4rem 0.6rem; border: 1px solid var(--edge); border-radius: 6px; }
.lesson-aircraft legend { color: var(--ink-dim); font-size: 0.85rem; }

/* Esporta / importa aeroporti e tipi di aereo */
.exchange { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--edge); display: flex; flex-direction: column; gap: 0.5rem; }
.exchange__title { margin: 0; font-size: 1rem; }
.exchange__aircraft summary { cursor: pointer; }
.exchange__aircraft label.check { margin: 0.2rem 0 0 0.6rem; }
.exchange__report ul { margin: 0.3rem 0 0; padding-left: 1.1rem; }
.exchange input[type=file] { max-width: 100%; }
