/* Flight Ops Cockpit — the day, step by step (3.1.23). Theme tokens only; responsive.css stays last. */

/* ---- Dashboard order: steps first; the schedule leads only when no flight is open ---------- */
#today.screen.active { display: flex; flex-direction: column; }
#today > .syncbar { order: 0; }
#today > #dayFlow { order: 1; }
#today > #cmsScheduleCard, #today > [data-df-fold="schedule"] { order: 3; }
#today > .v6-layout { order: 2; }
#today > #cmsDayModalHost { order: 4; }
body.df-noflight #today > #cmsScheduleCard, body.df-noflight #today > [data-df-fold="schedule"] { order: 1; }
body.df-noflight #today > #dayFlow { order: 2; }
body.df-noflight #today > .v6-layout { order: 3; }
/* on duty, cockpit-v3118.css lifts the flight card (order -1); the steps go just above it */
#today.on-duty > #dayFlow { order: -1; }

/* ---- step row ------------------------------------------------------------------------------ */
.df { margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--radius-panel, 14px); background: var(--card, #fff); overflow: hidden; }
.df-steps { list-style: none; margin: 0; padding: 10px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; counter-reset: none; }
.df-steps li { margin: 0; min-width: 0; }
.df-step { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: inherit; font-weight: 800; font-size: 13px; letter-spacing: .02em; text-align: left; cursor: pointer; }
.df-num { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; border: 2px solid var(--line); color: var(--muted); }
.df-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-step.done { color: var(--muted); }
.df-step.done .df-num { background: var(--ok, #228a57); border-color: var(--ok, #228a57); color: #fff; }
.df-step.warn .df-num { background: var(--warn, #b56d0a); border-color: var(--warn, #b56d0a); color: #fff; }
.df-step.active .df-num { border-color: var(--blue, #2d6fa3); color: var(--blue, #2d6fa3); }
.df-step[aria-current="step"] { border-color: var(--gold, #b7923f); box-shadow: inset 0 0 0 1px var(--gold, #b7923f); background: rgba(183, 146, 63, .08); }
.df-step[aria-current="step"] .df-num { border-color: var(--gold, #b7923f); color: var(--gold, #b7923f); }

/* ---- NEXT bar ------------------------------------------------------------------------------ */
.df-next { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-top: 1px solid var(--line); background: rgba(183, 146, 63, .06); }
.df-next.done { background: rgba(34, 138, 87, .07); }
.df-next-text { display: grid; gap: 2px; min-width: 0; }
.df-next-text small { font-size: 10px; font-weight: 900; letter-spacing: .1em; color: var(--muted); }
.df-next-text b { font-size: 20px; font-weight: 900; }
.df-next-text span { font-size: 13px; color: var(--muted); }
.df-next-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.df-next-actions .btn { min-height: 48px; padding: 10px 18px; font-weight: 900; }

/* ---- folded panels ------------------------------------------------------------------------- */
.df-folded { display: none !important; }
.df-fold { display: flex; width: 100%; align-items: center; gap: 6px; margin: 10px 0 8px; padding: 12px 14px; min-height: 46px;
  border: 1px dashed var(--line); border-radius: 12px; background: transparent; color: var(--muted); font-weight: 800; font-size: 13px; letter-spacing: .03em; text-align: left; cursor: pointer; }
.df-fold[aria-expanded="true"] { border-style: solid; color: inherit; }
.planning-support-grid > .df-fold { grid-column: 1 / -1; }

/* ---- Log: sector tabs and grouped fields --------------------------------------------------- */
.df-sector-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.df-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 14px 6px 8px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: inherit; font-weight: 800; font-size: 13px; cursor: pointer; }
.df-tab.sel { border-color: var(--gold, #b7923f); box-shadow: inset 0 0 0 1px var(--gold, #b7923f); background: rgba(183, 146, 63, .08); }
.df-tab.done .df-num { background: var(--ok, #228a57); border-color: var(--ok, #228a57); color: #fff; }
.df-tab.active .df-num { border-color: var(--blue, #2d6fa3); color: var(--blue, #2d6fa3); }
.df-tab.all { padding: 6px 16px; }
.sector.df-hidden { display: none !important; }
.df-group { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.df-group:first-of-type { border-top: 0; padding-top: 0; }
.df-group-title { font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--gold, #8a6a1f); margin-bottom: 6px; }
.df-group > .grid4 { margin: 0; }

body.night-mode .df, body.night-mode .df-step, body.night-mode .df-fold, body.night-mode .df-tab { border-color: #2b3034; }
body.night-mode .df { background: #0d1115; }

@media (max-width: 899px) {
  .df-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 699px) {
  .df-steps { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; padding: 8px; }
  .df-step { flex-direction: column; justify-content: center; gap: 3px; padding: 6px 2px; min-height: 58px; text-align: center; }
  .df-label { font-size: 10px; white-space: normal; line-height: 1.1; }
  .df-num { width: 24px; height: 24px; font-size: 12px; }
  .df-next-text b { font-size: 17px; }
  .df-next-actions { width: 100%; }
  .df-next-actions .btn { flex: 1 1 auto; }
  .df-tab { flex: 1 1 calc(50% - 6px); justify-content: flex-start; }
}
/* phone: route and times stay two across, so FROM → TO and OFF/ON read as pairs */
@media (max-width: 699px) {
  .df-group[data-df-group="route"] > .grid4, .df-group[data-df-group="times"] > .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
