/* ================================================
   NOMADIC AVIATION — mission offers + current mission (js/nomadic.js)
   Layout follows nomadic-preview.html: selected offer / current trip on the left with its
   route map, the offer list on the right.
   ================================================ */
#nomadic-section {
    --nmd: #990036;
    --nmd-soft: rgba(153, 0, 54, .08);
    --nmd-ink: #1e293b;
    --nmd-muted: #64748b;
    --nmd-line: #e2e8f0;
    --nmd-bg: #f1f5f9;
    --nmd-raised: #fff;
    --nmd-ok: #16a34a;
}
body.dark-mode #nomadic-section {
    --nmd: #e0457b;      /* lighter brand tint so the accent reads on dark cards */
    --nmd-soft: rgba(224, 69, 123, .16);
    --nmd-ink: #e5e7eb;
    --nmd-muted: #9ca3af;
    --nmd-line: #3f3f46;
    --nmd-bg: #3a3a3c;
    --nmd-raised: #2c2c2e;
}

.nmd-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.5rem; }
.nmd-side { border-left: 1px solid var(--nmd-line); padding-left: 1.5rem; align-self: start; }
@media (max-width: 900px) {
    .nmd-grid { grid-template-columns: 1fr; }
    .nmd-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--nmd-line); padding-top: 1.25rem; }
}

.nmd-head { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .9rem; }
.nmd-head h2 { margin: 0 !important; }
.nmd-sub2 { margin-left: auto; font-size: .78rem; color: var(--nmd-muted); font-weight: 600; }

/* ---- detail (left) ---- */
.nmd-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.nmd-type { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .65rem; border-radius: 999px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--nmd-soft); color: var(--nmd); white-space: nowrap; }
.nmd-reg { font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: .78rem; background: var(--nmd-bg); color: var(--nmd-ink); padding: .22rem .55rem; border-radius: 8px; }
.nmd-flag { font-size: .7rem; font-weight: 700; color: #92400e; background: #fef3c7; padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; }
.nmd-cust { margin-left: auto; width: 120px; height: 40px; object-fit: contain; }
.nmd-lead { margin: .6rem 0 .15rem; font-size: 1.15rem; font-weight: 800; color: var(--nmd-ink); }
.nmd-sub { color: var(--nmd-muted); font-size: .85rem; margin-bottom: .6rem; overflow-wrap: anywhere; }
.nmd-desc { margin: 0 0 .9rem; font-size: .9rem; line-height: 1.55; color: var(--nmd-ink); }
.nmd-progress { height: 6px; border-radius: 999px; background: var(--nmd-bg); overflow: hidden; margin: 0 0 .9rem; }
.nmd-progress div { height: 100%; background: var(--nmd); border-radius: 999px; }
.nmd-map { height: 260px; border-radius: 14px; border: 1px solid var(--nmd-line); overflow: hidden; z-index: 0; }
.nmd-why { display: flex; flex-wrap: wrap; gap: .4rem; margin: .75rem 0 .9rem; }
.nmd-why span { font-size: .72rem; background: var(--nmd-raised); border: 1px solid var(--nmd-line); border-radius: 999px; padding: .2rem .6rem; color: var(--nmd-ink); }
.nmd-why span i { color: var(--nmd-ok); margin-right: .3rem; }

.nmd-legs { border: 1px solid var(--nmd-line); border-radius: 14px; overflow: hidden; margin-bottom: .9rem; }
.nmd-jobh { display: flex; align-items: center; gap: .45rem; background: var(--nmd-bg); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--nmd-muted); padding: .45rem .75rem; }
.nmd-jobh i { color: var(--nmd); }
.nmd-jobh b { font-family: ui-monospace, Consolas, monospace; text-transform: none; color: var(--nmd-ink); }
.nmd-leg { display: grid; grid-template-columns: 24px 1fr auto auto; gap: .6rem; align-items: center; padding: .55rem .75rem; border-top: 1px solid var(--nmd-line); font-size: .84rem; color: var(--nmd-ink); }
.nmd-legs > .nmd-leg:first-child { border-top: 0; }
.nmd-leg b { font-family: ui-monospace, Consolas, monospace; }
.nmd-leg small { color: var(--nmd-muted); margin-left: .25rem; }
.nmd-n { width: 22px; height: 22px; border-radius: 50%; background: var(--nmd-ink); color: var(--nmd-raised); font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.nmd-leg.pos { color: var(--nmd-muted); background: var(--nmd-bg); }
.nmd-leg.pos .nmd-n { background: #cbd5e1; color: #475569; font-size: .6rem; }
.nmd-leg.done { color: var(--nmd-muted); }
.nmd-leg.done .nmd-n { background: #dcfce7; color: var(--nmd-ok); }
.nmd-leg.now { background: var(--nmd-soft); }
.nmd-leg.now .nmd-n { background: var(--nmd); color: #fff; }
.nmd-tag { font-size: .66rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; background: var(--nmd-bg); color: var(--nmd-muted); white-space: nowrap; }
.nmd-tag.fuel { background: #eff6ff; color: #1d4ed8; }
.nmd-tag.dest { background: #ecfdf5; color: #047857; }
.nmd-tag.test { background: #fef3c7; color: #92400e; }
.nmd-tag.now { background: var(--nmd); color: #fff; }
.nmd-t { color: var(--nmd-muted); font-variant-numeric: tabular-nums; text-align: right; }

.nmd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: .9rem; }
.nmd-stats div { background: var(--nmd-bg); border-radius: 12px; padding: .5rem .75rem; }
.nmd-stats small { display: block; font-size: .66rem; font-weight: 600; text-transform: uppercase; color: var(--nmd-muted); }
.nmd-stats b { font-size: .92rem; color: var(--nmd-ink); }
.nmd-note { display: flex; gap: .5rem; align-items: baseline; background: #eff6ff; color: #1e3a8a; border-radius: 12px; padding: .6rem .8rem; font-size: .8rem; line-height: 1.45; margin-bottom: .9rem; }
.nmd-note.warn { background: #fef3c7; color: #92400e; }
body.dark-mode #nomadic-section .nmd-note { background: rgba(59, 130, 246, .15); color: #bfdbfe; }
body.dark-mode #nomadic-section .nmd-note.warn { background: rgba(245, 158, 11, .15); color: #fde68a; }

.nmd-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.nmd-btn { display: inline-flex; align-items: center; gap: .45rem; border: 0; border-radius: 12px; padding: .6rem 1rem; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; text-decoration: none; }
.nmd-btn.primary { background: var(--nmd); color: #fff; }
.nmd-btn.ghost { background: transparent; color: var(--nmd-ink); border: 1px solid var(--nmd-line); }
.nmd-btn.danger { color: #dc2626; }
.nmd-lock { display: flex; align-items: center; gap: .45rem; font-size: .76rem; font-weight: 700; color: var(--nmd-muted); }

/* ---- offer list (right) ---- */
.nmd-list { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .9rem; }
.nmd-qi { border: 1px solid var(--nmd-line); border-radius: 14px; padding: .8rem .9rem; display: grid; grid-template-columns: 1fr auto; gap: .25rem .7rem; cursor: pointer; background: var(--nmd-raised); transition: border-color .15s, box-shadow .15s; }
.nmd-qi:hover { border-color: #cbd5e1; }
.nmd-qi.sel { border-color: var(--nmd); box-shadow: 0 0 0 3px var(--nmd-soft); }
.nmd-qi.locked { background: var(--nmd-bg); cursor: default; }
.nmd-qi.locked > :not(.nmd-lock) { opacity: .5; filter: grayscale(1); }
.nmd-qi-top { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.nmd-qi-ac { font-weight: 700; font-size: .86rem; color: var(--nmd-ink); }
.nmd-route { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; color: var(--nmd-ink); overflow-wrap: anywhere; }
.nmd-meta { color: var(--nmd-muted); font-size: .74rem; }
.nmd-fee { text-align: right; font-weight: 800; font-size: 1rem; color: var(--nmd-ink); align-self: center; grid-row: 1 / span 3; grid-column: 2; }
.nmd-fee small { display: block; font-size: .68rem; font-weight: 500; color: var(--nmd-muted); }
.nmd-qa { grid-column: 1 / -1; margin-top: .35rem; }
.nmd-qa .nmd-btn { padding: .45rem .85rem; font-size: .78rem; }
.nmd-qi .nmd-lock { grid-column: 1 / -1; margin-top: .2rem; }

.nmd-intro { margin: 0 0 .9rem; font-size: .8rem; line-height: 1.5; color: var(--nmd-muted); }
.nmd-empty { padding: 1.5rem 1rem; text-align: center; color: var(--nmd-muted); font-size: .85rem; line-height: 1.5; }
.nmd-empty i { display: block; font-size: 1.4rem; color: #cbd5e1; margin-bottom: .5rem; }
.nmd-ratings { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; padding-top: .8rem; border-top: 1px solid var(--nmd-line); }
.nmd-ratings em { font-style: normal; font-size: .74rem; color: var(--nmd-muted); margin-right: .2rem; }
.nmd-ratings span { background: #ecfdf5; color: #047857; font-weight: 700; font-size: .7rem; padding: .2rem .6rem; border-radius: 999px; }
.nmd-ratings span.none { background: var(--nmd-bg); color: var(--nmd-muted); }

@media (max-width: 640px) {
    .nmd-stats { grid-template-columns: repeat(2, 1fr); }
    .nmd-cust { width: 90px; }
    .nmd-leg { grid-template-columns: 22px 1fr auto; }
    .nmd-leg .nmd-t { display: none; }
    .nmd-map { height: 200px; }
}


/* Crew Scheduling for Nomadic pilots: no bidding, so its chrome goes (class set by js/bidding.js) */
body.nmd-ops #sched-steps,
body.nmd-ops #sp-odds,
body.nmd-ops #sp-record,
body.nmd-ops #sched-status-strip,
body.nmd-ops .sp-clock { display: none !important; }
