body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin: 12px; background: #f5f6f8; color: #1a1a1a; }
button { padding: 8px 14px; cursor: pointer; border-radius: 8px; border: 1px solid #d4d4d4; background: #fff; font-size: 13px; transition: background .15s, border-color .15s; }
button:hover { background: #f4f4f4; }
input, textarea, select { box-sizing: border-box; padding: 10px; border-radius: 8px; border: 1px solid #cfcfcf; }
textarea { resize: vertical; min-height: 36px; }
td input, td textarea, td select, .cell-input { padding: 5px 8px; border-radius: 6px; font-size: 13px; }
.hint { color:#666; font-size: 12px; margin-top: 4px; }
.err { color:#b00020; font-size: 13px; margin-top: 8px; }
.ok { color:#0a7a2f; font-size: 13px; margin-top: 8px; }
.topbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; padding: 8px 0; }
.searchWrap { display:flex; flex-direction:column; gap:4px; min-width: 200px; max-width: 400px; flex: 1; }
.filters { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.pill { border:1px solid #bbb; background:#fff; border-radius: 999px; padding: 7px 12px; font-weight:600; font-size: 13px; transition: background .15s, border-color .15s; }
.pill.active { background:#111; color:#fff; border-color:#111; }
.loading { font-size:12px; color:#444; padding:6px 10px; position: fixed; top: 12px; right: 12px; background: #fff; border: 1px solid #ddd; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,0.08); z-index: 5; }
.hidden { display:none !important; }

.summary { display:flex; gap:12px; flex-wrap:wrap; align-items:stretch; margin-top: 12px; }
.summaryCard { border:1px solid #e1e1e1; background:#fff; border-radius: 12px; padding: 10px 14px; min-width: 140px; }
.summaryTitle { font-size: 12px; color:#555; text-transform: uppercase; letter-spacing: 0.04em; }
.summaryValue { font-size: 22px; font-weight: 700; margin-top: 4px; }
.summaryMeta { font-size: 12px; color:#666; margin-top: 2px; }
.summaryLegend { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-left: auto; }
.legendItem { border-radius: 999px; padding: 6px 10px; font-size: 12px; background: #f4f4f4; color:#333; border: 1px solid #ddd; }
.legendItem.gate { background: #fff2cc; border-color:#e4d39b; }
.legendItem.time { background: #d9e1f2; border-color:#b9c6e0; }
.legendItem.arr { background: #e9f7ef; border-color:#b9e2cc; }
.legendItem.dep { background: #fdecea; border-color:#f4c7c3; }

.tableWrap { margin-top: 12px; border: 1px solid #e1e1e1; border-radius: 12px; overflow: auto; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid #eee; border-right: 1px solid #eee; padding: 7px 8px; vertical-align: middle; }
th:last-child, td:last-child { border-right: none; }
th { position: sticky; top: 0; background: #f4f5f7; z-index: 2; text-transform: uppercase; font-size: 11px; letter-spacing: 0.04em; color: #555; font-weight: 600; white-space: nowrap; }
tbody tr:nth-child(even) { background: #f9fafb; }
tbody tr:hover { background: #f0f4ff; }

.small { font-size: 12px; color:#333; }
.alert { font-weight: 700; }
.num { text-align: center; }
.cell-input { width: 100%; }
.watchCell { text-align: center; }
.watch-toggle { transform: scale(1.1); }
.empty { text-align: center; padding: 24px 12px; color: #666; font-size: 13px; }
.quiet { font-weight: 600; }

.cell-gate-changed, .cell-gatechg { background: #fff2cc; font-weight: 700; border-left: 3px solid #e6b800; }
.cell-time-changed, .cell-timechg { background: #d9e1f2; font-weight: 700; border-left: 3px solid #4a6fa5; }
.wchr-changed, .wchc-changed { background: #e8f5e9; font-weight: 700; border-left: 3px solid #43a047; }

.type-arr { background: #e9f7ef; font-weight: 700; text-align:center; }
.type-dep { background: #fdecea; font-weight: 700; text-align:center; }

.card { max-width: 420px; border:1px solid #ddd; padding:16px; border-radius: 10px; }
.row { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }

/* ── WINGS Navigation Bar ──────────────────── */
.wings-nav {
  display: flex;
  align-items: center;
  gap: 0;
  background: #111827;
  color: #fff;
  padding: 0 16px;
  height: 46px;
  margin: -12px -12px 12px -12px;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  position: sticky;
  top: -12px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.wings-nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 6px;
  padding-right: 14px;
  border-right: 1px solid rgba(255,255,255,.15);
  text-decoration: none;
  color: #fff;
}
.wings-nav-brand svg { width: 26px; height: 26px; flex-shrink: 0; }
.wings-nav-brand span {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #7C5CFF, #00D4FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.wings-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  padding-left: 6px;
}
.wings-nav-link {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.wings-nav-link:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.wings-nav-link.active {
  background: rgba(124,92,255,.25);
  color: #fff;
}
.wings-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.wings-nav-user {
  font-size: 12px;
  color: rgba(255,255,255,.55);
  white-space: nowrap;
}
.wings-nav-logout {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.wings-nav-logout:hover {
  background: rgba(255,77,109,.25);
  color: #fff;
}

/* ── Dashboard viewport layout (sticky table headers) ── */
html { height: 100%; }
body.dashboard {
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.dashboard .wings-nav { margin: 0; top: 0; }
.page-content {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 0 12px 12px;
}
.page-content > .topbar,
.page-content > .topbar-primary,
.page-content > .topbar-filters,
.page-content > .view-only-banner,
.page-content > .summary,
.page-content > #err,
.page-content > #loading { flex-shrink: 0; }
.page-content > .tableWrap { flex: 1; min-height: 0; }
.page-content > .page-layout { flex: 1; min-height: 0; overflow: hidden; }

@media (max-width: 900px) {
  th, td { padding: 6px; }
  .wings-nav { padding: 0 10px; gap: 0; }
  .wings-nav-link { padding: 6px 10px; font-size: 12px; }
  .wings-nav-user { display: none; }
}
@media (max-width: 600px) {
  .wings-nav-brand span { display: none; }
  .wings-nav-link { padding: 5px 8px; font-size: 11px; }
}
